Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add user-friendly error when no alloc or std feature are enabled
- Loading branch information
Showing
3 changed files
with
16 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"serde_json doesn't work without `alloc` or default `std` feature yet" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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! { | ||
This comment has been minimized.
Sorry, something went wrong. |
||
mod error; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -432,6 +432,8 @@ pub mod map; | |
pub mod ser; | ||
pub mod value; | ||
|
||
mod features_check; | ||
|
||
mod io; | ||
mod iter; | ||
mod number; | ||
|
Could this part be
#[rustfmt::skip]
?