Merge pull request 1124 from mleonhard/master

This commit is contained in:
David Tolnay 2024-04-15 21:53:43 -07:00
commit 051ce970fe
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
3 changed files with 5 additions and 16 deletions

View File

@ -1 +0,0 @@
"serde_json requires that either `std` (default) or `alloc` feature is enabled"

View File

@ -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;
}

View File

@ -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;