Add user-friendly error when no alloc or std feature are enabled

This commit is contained in:
Igor Matuszewski
2020-01-21 15:51:53 +01:00
committed by Igor Matuszewski
parent 176ff712f8
commit 7852d2f1e6
3 changed files with 16 additions and 0 deletions

View File

@@ -0,0 +1 @@
"serde_json doesn't work without `alloc` or default `std` feature yet"

13
src/features_check/mod.rs Normal file
View File

@@ -0,0 +1,13 @@
//! Shows a user-friendly compiler error on incompatible selected features.
#[allow(unused_macros)]
macro_rules! hide_from_rustfmt {
($mod:item) => {
$mod
};
}
#[cfg(all(not(feature = "std"), not(feature = "alloc")))]
hide_from_rustfmt! {
mod error;
}

View File

@@ -432,6 +432,8 @@ pub mod map;
pub mod ser;
pub mod value;
mod features_check;
mod io;
mod iter;
mod number;