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
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
5 changed files with 7 additions and 12 deletions

View File

@ -77,7 +77,7 @@ jobs:
strategy: strategy:
fail-fast: false fail-fast: false
matrix: matrix:
rust: [1.19.0, 1.20.0, 1.21.0, 1.25.0, 1.26.0, 1.34.0] rust: [1.20.0, 1.21.0, 1.25.0, 1.26.0, 1.34.0]
timeout-minutes: 45 timeout-minutes: 45
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3

View File

@ -1,12 +1,12 @@
# Serde   [![Build Status]][actions] [![Latest Version]][crates.io] [![serde: rustc 1.19+]][Rust 1.19] [![serde_derive: rustc 1.56+]][Rust 1.56] # Serde   [![Build Status]][actions] [![Latest Version]][crates.io] [![serde: rustc 1.20+]][Rust 1.20] [![serde_derive: rustc 1.56+]][Rust 1.56]
[Build Status]: https://img.shields.io/github/actions/workflow/status/serde-rs/serde/ci.yml?branch=master [Build Status]: https://img.shields.io/github/actions/workflow/status/serde-rs/serde/ci.yml?branch=master
[actions]: https://github.com/serde-rs/serde/actions?query=branch%3Amaster [actions]: https://github.com/serde-rs/serde/actions?query=branch%3Amaster
[Latest Version]: https://img.shields.io/crates/v/serde.svg [Latest Version]: https://img.shields.io/crates/v/serde.svg
[crates.io]: https://crates.io/crates/serde [crates.io]: https://crates.io/crates/serde
[serde: rustc 1.19+]: https://img.shields.io/badge/serde-rustc_1.19+-lightgray.svg [serde: rustc 1.20+]: https://img.shields.io/badge/serde-rustc_1.20+-lightgray.svg
[serde_derive: rustc 1.56+]: https://img.shields.io/badge/serde_derive-rustc_1.56+-lightgray.svg [serde_derive: rustc 1.56+]: https://img.shields.io/badge/serde_derive-rustc_1.56+-lightgray.svg
[Rust 1.19]: https://blog.rust-lang.org/2017/07/20/Rust-1.19.html [Rust 1.20]: https://blog.rust-lang.org/2017/08/31/Rust-1.20.html
[Rust 1.56]: https://blog.rust-lang.org/2021/10/21/Rust-1.56.0.html [Rust 1.56]: https://blog.rust-lang.org/2021/10/21/Rust-1.56.0.html
**Serde is a framework for *ser*ializing and *de*serializing Rust data structures efficiently and generically.** **Serde is a framework for *ser*ializing and *de*serializing Rust data structures efficiently and generically.**

View File

@ -11,7 +11,7 @@ keywords = ["serde", "serialization", "no_std"]
license = "MIT OR Apache-2.0" license = "MIT OR Apache-2.0"
readme = "crates-io.md" readme = "crates-io.md"
repository = "https://github.com/serde-rs/serde" repository = "https://github.com/serde-rs/serde"
rust-version = "1.19" rust-version = "1.20"
[dependencies] [dependencies]
serde_derive = { version = "=1.0.179", optional = true, path = "../serde_derive" } serde_derive = { version = "=1.0.179", optional = true, path = "../serde_derive" }

View File

@ -16,11 +16,9 @@ fn main() {
let target = env::var("TARGET").unwrap(); let target = env::var("TARGET").unwrap();
let emscripten = target == "asmjs-unknown-emscripten" || target == "wasm32-unknown-emscripten"; 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: // PathBuf::into_boxed_path stabilized in Rust 1.20:
// https://doc.rust-lang.org/std/ffi/struct.CString.html#method.into_boxed_c_str
// https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.into_boxed_path // https://doc.rust-lang.org/std/path/struct.PathBuf.html#method.into_boxed_path
if minor < 20 { if minor < 20 {
println!("cargo:rustc-cfg=no_de_boxed_c_str");
println!("cargo:rustc-cfg=no_de_boxed_path"); println!("cargo:rustc-cfg=no_de_boxed_path");
} }

View File

@ -747,10 +747,7 @@ macro_rules! forwarded_impl {
} }
} }
#[cfg(all( #[cfg(any(feature = "std", all(not(no_core_cstr), feature = "alloc")))]
any(feature = "std", all(not(no_core_cstr), feature = "alloc")),
not(no_de_boxed_c_str)
))]
forwarded_impl!((), Box<CStr>, CString::into_boxed_c_str); forwarded_impl!((), Box<CStr>, CString::into_boxed_c_str);
forwarded_impl!((T), Reverse<T>, Reverse); forwarded_impl!((T), Reverse<T>, Reverse);