From a00aee14950baca7de2e334b895e203b013712da Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sun, 27 Oct 2019 13:38:25 -0700 Subject: [PATCH] Use a dedicated cfg for PathBuf::into_boxed_path --- serde/build.rs | 1 + serde/src/de/impls.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/serde/build.rs b/serde/build.rs index a78b6d79..1453adf1 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 cffe0590..efd194cc 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); ////////////////////////////////////////////////////////////////////////////////