From c42e7c8012bc906fecb3c030221dc5bef51761a6 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Fri, 17 Mar 2023 17:34:46 -0700 Subject: [PATCH] Reflect serde_derive required compiler in build script and rust-version metadata --- serde/build.rs | 10 +++++----- serde_derive/Cargo.toml | 2 +- serde_derive_internals/Cargo.toml | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/serde/build.rs b/serde/build.rs index 304a6c761..929d8e172 100644 --- a/serde/build.rs +++ b/serde/build.rs @@ -78,11 +78,6 @@ fn main() { println!("cargo:rustc-cfg=no_num_nonzero"); } - // Current minimum supported version of serde_derive crate is Rust 1.31. - if minor < 31 { - println!("cargo:rustc-cfg=no_serde_derive"); - } - // TryFrom, Atomic types, non-zero signed integers, and SystemTime::checked_add // stabilized in Rust 1.34: // https://blog.rust-lang.org/2019/04/11/Rust-1.34.0.html#tryfrom-and-tryinto @@ -94,6 +89,11 @@ fn main() { println!("cargo:rustc-cfg=no_relaxed_trait_bounds"); } + // Current minimum supported version of serde_derive crate is Rust 1.56. + if minor < 56 { + println!("cargo:rustc-cfg=no_serde_derive"); + } + // Support for #[cfg(target_has_atomic = "...")] stabilized in Rust 1.60. if minor < 60 { println!("cargo:rustc-cfg=no_target_has_atomic"); diff --git a/serde_derive/Cargo.toml b/serde_derive/Cargo.toml index b9e40c1f2..7272c744e 100644 --- a/serde_derive/Cargo.toml +++ b/serde_derive/Cargo.toml @@ -11,7 +11,7 @@ keywords = ["serde", "serialization", "no_std", "derive"] license = "MIT OR Apache-2.0" readme = "crates-io.md" repository = "https://github.com/serde-rs/serde" -rust-version = "1.31" +rust-version = "1.56" [features] default = [] diff --git a/serde_derive_internals/Cargo.toml b/serde_derive_internals/Cargo.toml index 5bb3acd58..27c5f4e2a 100644 --- a/serde_derive_internals/Cargo.toml +++ b/serde_derive_internals/Cargo.toml @@ -9,7 +9,7 @@ include = ["lib.rs", "src/**/*.rs", "LICENSE-APACHE", "LICENSE-MIT"] keywords = ["serde", "serialization"] license = "MIT OR Apache-2.0" repository = "https://github.com/serde-rs/serde" -rust-version = "1.31" +rust-version = "1.56" [lib] path = "lib.rs"