mirror of
https://github.com/serde-rs/json.git
synced 2026-04-19 05:06:00 +00:00
Add user-friendly error when no alloc or std feature are enabled
This commit is contained in:
committed by
Igor Matuszewski
parent
176ff712f8
commit
7852d2f1e6
1
src/features_check/error.rs
Normal file
1
src/features_check/error.rs
Normal file
@@ -0,0 +1 @@
|
||||
"serde_json doesn't work without `alloc` or default `std` feature yet"
|
||||
13
src/features_check/mod.rs
Normal file
13
src/features_check/mod.rs
Normal 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;
|
||||
}
|
||||
@@ -432,6 +432,8 @@ pub mod map;
|
||||
pub mod ser;
|
||||
pub mod value;
|
||||
|
||||
mod features_check;
|
||||
|
||||
mod io;
|
||||
mod iter;
|
||||
mod number;
|
||||
|
||||
Reference in New Issue
Block a user