From 63bbfe35d88c86a32f56b35677c84c1efec76687 Mon Sep 17 00:00:00 2001 From: Raito Bezarius Date: Sat, 10 Jun 2023 18:06:50 +0200 Subject: [PATCH] feat(stub): throw compile error in case of enabling fat and thin features This is more helpful than a weird compilation error on borrow checking rules! --- rust/stub/src/main.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/rust/stub/src/main.rs b/rust/stub/src/main.rs index 7beb836..0e90aa8 100644 --- a/rust/stub/src/main.rs +++ b/rust/stub/src/main.rs @@ -20,6 +20,9 @@ mod fat; #[cfg(feature = "thin")] mod thin; +#[cfg(all(feature = "fat", feature = "thin"))] +compile_error!("A thin and fat stub cannot be produced at the same time, disable either `thin` or `fat` feature"); + use efivars::{export_efi_variables, get_loader_features, EfiLoaderFeatures}; use log::info; use measure::measure_image;