diff --git a/serde/build.rs b/serde/build.rs index a78b6d79a..1453adf10 100644 --- a/serde/build.rs +++ b/serde/build.rs @@ -34,6 +34,7 @@ fn main() { // https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.into_boxed_path if minor >= 20 { println!("cargo:rustc-cfg=de_boxed_c_str"); + println!("cargo:rustc-cfg=de_boxed_path"); } // From> for Rc / Arc stabilized in Rust 1.21: diff --git a/serde/src/de/impls.rs b/serde/src/de/impls.rs index cffe05900..efd194ccc 100644 --- a/serde/src/de/impls.rs +++ b/serde/src/de/impls.rs @@ -1610,7 +1610,7 @@ impl<'de> Deserialize<'de> for PathBuf { } } -#[cfg(all(feature = "std", de_boxed_c_str))] +#[cfg(all(feature = "std", de_boxed_path))] forwarded_impl!((), Box, PathBuf::into_boxed_path); ////////////////////////////////////////////////////////////////////////////////