diff --git a/serde_core/src/lib.rs b/serde_core/src/lib.rs index 0d15c6ad..5ad57cdb 100644 --- a/serde_core/src/lib.rs +++ b/serde_core/src/lib.rs @@ -102,7 +102,7 @@ //////////////////////////////////////////////////////////////////////////////// -#[cfg(feature = "alloc")] +#[cfg(all(not(feature = "std"), feature = "alloc"))] extern crate alloc; // Explicitly import core crate for no_std targets (especially wasm32v1-none)