diff --git a/src/features_check/error.rs b/src/features_check/error.rs deleted file mode 100644 index 22e58235c..000000000 --- a/src/features_check/error.rs +++ /dev/null @@ -1 +0,0 @@ -"serde_json requires that either `std` (default) or `alloc` feature is enabled" diff --git a/src/features_check/mod.rs b/src/features_check/mod.rs deleted file mode 100644 index d12032cef..000000000 --- a/src/features_check/mod.rs +++ /dev/null @@ -1,13 +0,0 @@ -//! Shows a user-friendly compiler error on incompatible selected features. - -#[allow(unused_macros)] -macro_rules! hide_from_rustfmt { - ($mod:item) => { - $mod - }; -} - -#[cfg(not(any(feature = "std", feature = "alloc")))] -hide_from_rustfmt! { - mod error; -} diff --git a/src/lib.rs b/src/lib.rs index 32c4fc456..5d730102b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -363,6 +363,11 @@ #![no_std] #![cfg_attr(docsrs, feature(doc_cfg))] +#[cfg(not(any(feature = "std", feature = "alloc")))] +compile_error! { + "serde_json requires that either `std` (default) or `alloc` feature is enabled" +} + extern crate alloc; #[cfg(feature = "std")] @@ -409,8 +414,6 @@ pub mod ser; mod ser; pub mod value; -mod features_check; - mod io; #[cfg(feature = "std")] mod iter;