Use a dedicated cfg for PathBuf::into_boxed_path

This commit is contained in:
David Tolnay 2019-10-27 13:38:25 -07:00
parent 4e31c9984d
commit a00aee1495
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
2 changed files with 2 additions and 1 deletions

View File

@ -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<Box<T>> for Rc<T> / Arc<T> stabilized in Rust 1.21:

View File

@ -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<Path>, PathBuf::into_boxed_path);
////////////////////////////////////////////////////////////////////////////////