Stabilize Deserialize for Box<CStr>

This commit is contained in:
David Tolnay 2018-05-26 09:48:50 -07:00
parent 1385aac208
commit 7ec3cac7d6
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
2 changed files with 7 additions and 1 deletions

View File

@ -33,6 +33,12 @@ fn main() {
Err(_) => return,
};
// CString::into_boxed_c_str stabilized in Rust 1.20:
// https://doc.rust-lang.org/std/ffi/struct.CString.html#method.into_boxed_c_str
if minor >= 20 {
println!("cargo:rustc-cfg=de_boxed_c_str");
}
// 128-bit integers stabilized in Rust 1.26:
// https://blog.rust-lang.org/2018/05/10/Rust-1.26.html
if minor >= 26 {

View File

@ -573,7 +573,7 @@ macro_rules! forwarded_impl {
}
}
#[cfg(all(feature = "std", feature = "unstable"))]
#[cfg(all(feature = "std", de_boxed_c_str))]
forwarded_impl!((), Box<CStr>, CString::into_boxed_c_str);
////////////////////////////////////////////////////////////////////////////////