Delete support for compilers without CString::into_boxed_c_str

This commit is contained in:
David Tolnay
2023-07-27 22:32:00 -07:00
parent a100719bc6
commit c91737fef1
5 changed files with 7 additions and 12 deletions
+1 -1
View File
@@ -11,7 +11,7 @@ keywords = ["serde", "serialization", "no_std"]
license = "MIT OR Apache-2.0"
readme = "crates-io.md"
repository = "https://github.com/serde-rs/serde"
rust-version = "1.19"
rust-version = "1.20"
[dependencies]
serde_derive = { version = "=1.0.179", optional = true, path = "../serde_derive" }
+1 -3
View File
@@ -16,11 +16,9 @@ fn main() {
let target = env::var("TARGET").unwrap();
let emscripten = target == "asmjs-unknown-emscripten" || target == "wasm32-unknown-emscripten";
// CString::into_boxed_c_str and PathBuf::into_boxed_path stabilized in Rust 1.20:
// https://doc.rust-lang.org/std/ffi/struct.CString.html#method.into_boxed_c_str
// PathBuf::into_boxed_path stabilized in Rust 1.20:
// https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.into_boxed_path
if minor < 20 {
println!("cargo:rustc-cfg=no_de_boxed_c_str");
println!("cargo:rustc-cfg=no_de_boxed_path");
}
+1 -4
View File
@@ -747,10 +747,7 @@ macro_rules! forwarded_impl {
}
}
#[cfg(all(
any(feature = "std", all(not(no_core_cstr), feature = "alloc")),
not(no_de_boxed_c_str)
))]
#[cfg(any(feature = "std", all(not(no_core_cstr), feature = "alloc")))]
forwarded_impl!((), Box<CStr>, CString::into_boxed_c_str);
forwarded_impl!((T), Reverse<T>, Reverse);