From 7c9f9a5a1dae3f9c2c16748b6d5af9fc134abe65 Mon Sep 17 00:00:00 2001 From: "James O. D. Hunt" Date: Wed, 17 Aug 2022 18:06:29 +0100 Subject: [PATCH] kata-ctl: Make arch test run at compile time Changed the `panic!()` call to a `compile_error!()` one to ensure it fires at compile time rather than runtime. Signed-off-by: James O. D. Hunt --- src/tools/kata-ctl/src/arch/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/kata-ctl/src/arch/mod.rs b/src/tools/kata-ctl/src/arch/mod.rs index ee6f926f7..c18fb0c09 100644 --- a/src/tools/kata-ctl/src/arch/mod.rs +++ b/src/tools/kata-ctl/src/arch/mod.rs @@ -3,7 +3,7 @@ // SPDX-License-Identifier: Apache-2.0 // -use anyhow::{Result}; +use anyhow::Result; #[cfg(target_arch = "aarch64")] pub mod aarch64; @@ -36,7 +36,7 @@ pub fn check(global_args: clap::ArgMatches) -> Result<()> { target_arch = "s390x", target_arch = "x86_64" )))] - panic!("unknown architecture"); + compile_error!("unknown architecture"); result }