From a287a264ba897d787ee7b733a3a69a81e7379462 Mon Sep 17 00:00:00 2001 From: guillaume didier Date: Mon, 9 Mar 2020 14:32:10 +0100 Subject: [PATCH] Add assertion to prevent attempts of building std and no_std at the same time --- cache_utils/src/lib.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cache_utils/src/lib.rs b/cache_utils/src/lib.rs index 01c1e3c..deefef3 100644 --- a/cache_utils/src/lib.rs +++ b/cache_utils/src/lib.rs @@ -1,5 +1,15 @@ #![cfg_attr(feature = "no_std", no_std)] +use static_assertions::assert_cfg; + +assert_cfg!( + all( + not(all(feature = "std", feature = "no_std")), + any(feature = "std", feature = "no_std") + ), + "Choose std or no-std but not both" +); + pub mod cache_info; pub mod calibration; pub mod prefetcher;