fix(compiler) std and core are mutually exclusive features.

This commit is contained in:
Ivan Enderlin
2020-05-19 09:44:18 +02:00
parent 40eea02af6
commit f9ae55d5d0

View File

@@ -25,11 +25,19 @@
)
)]
#[cfg(all(not(feature = "std"), feature = "core"))]
#[cfg(all(feature = "std", feature = "core"))]
compile_error!(
"The `std` and `core` features are both enabled, which is an error. Please enable only once."
);
#[cfg(all(not(feature = "std"), not(feature = "core")))]
compile_error!("Both the `std` and `core` features are disabled. Please enable one of them.");
#[cfg(feature = "core")]
extern crate alloc;
mod lib {
#[cfg(all(not(feature = "std"), feature = "core"))]
#[cfg(feature = "core")]
pub mod std {
#[macro_use]
pub use alloc::{boxed, string, vec};