From a57a324d7254c282f6032f9a65044bb5da34c4e1 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sun, 30 Jul 2023 21:05:06 -0700 Subject: [PATCH] Delete support for compilers without NonZero integer types --- .github/workflows/ci.yml | 10 ++-------- README.md | 6 +++--- serde/Cargo.toml | 2 +- serde/build.rs | 6 ------ serde/src/de/impls.rs | 2 +- serde/src/ser/impls.rs | 1 - 6 files changed, 7 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cc9a693f..568b4d64 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -83,18 +83,12 @@ jobs: - run: cd serde && cargo build more: - name: Rust ${{matrix.rust}} + name: Rust 1.28.0 runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - rust: [1.27.0, 1.28.0] timeout-minutes: 45 steps: - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@master - with: - toolchain: ${{matrix.rust}} + - uses: dtolnay/rust-toolchain@1.28.0 # Work around failing to parse manifest because editions are unstable. - run: sed -i /test_suite/d Cargo.toml - run: cd serde && cargo build --no-default-features diff --git a/README.md b/README.md index 6109fdf7..19f0d3c4 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ -# Serde   [![Build Status]][actions] [![Latest Version]][crates.io] [![serde: rustc 1.27+]][Rust 1.27] [![serde_derive: rustc 1.56+]][Rust 1.56] +# Serde   [![Build Status]][actions] [![Latest Version]][crates.io] [![serde: rustc 1.28+]][Rust 1.28] [![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 [actions]: https://github.com/serde-rs/serde/actions?query=branch%3Amaster [Latest Version]: https://img.shields.io/crates/v/serde.svg [crates.io]: https://crates.io/crates/serde -[serde: rustc 1.27+]: https://img.shields.io/badge/serde-rustc_1.27+-lightgray.svg +[serde: rustc 1.28+]: https://img.shields.io/badge/serde-rustc_1.28+-lightgray.svg [serde_derive: rustc 1.56+]: https://img.shields.io/badge/serde_derive-rustc_1.56+-lightgray.svg -[Rust 1.27]: https://blog.rust-lang.org/2018/06/21/Rust-1.27.html +[Rust 1.28]: https://blog.rust-lang.org/2018/08/02/Rust-1.28.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.** diff --git a/serde/Cargo.toml b/serde/Cargo.toml index 6d7a849e..eba6c5b7 100644 --- a/serde/Cargo.toml +++ b/serde/Cargo.toml @@ -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.27" +rust-version = "1.28" [dependencies] serde_derive = { version = "=1.0.179", optional = true, path = "../serde_derive" } diff --git a/serde/build.rs b/serde/build.rs index e76ac236..fb1cfa6d 100644 --- a/serde/build.rs +++ b/serde/build.rs @@ -16,12 +16,6 @@ fn main() { let target = env::var("TARGET").unwrap(); let emscripten = target == "asmjs-unknown-emscripten" || target == "wasm32-unknown-emscripten"; - // Non-zero integers stabilized in Rust 1.28: - // https://blog.rust-lang.org/2018/08/02/Rust-1.28.html#library-stabilizations - if minor < 28 { - println!("cargo:rustc-cfg=no_num_nonzero"); - } - // 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 diff --git a/serde/src/de/impls.rs b/serde/src/de/impls.rs index 124251de..0dd039b3 100644 --- a/serde/src/de/impls.rs +++ b/serde/src/de/impls.rs @@ -82,7 +82,7 @@ macro_rules! impl_deserialize_num { ($primitive:ident, $nonzero:ident $(cfg($($cfg:tt)*))*, $deserialize:ident $($method:ident!($($val:ident : $visit:ident)*);)*) => { impl_deserialize_num!($primitive, $deserialize $($method!($($val : $visit)*);)*); - #[cfg(all(not(no_num_nonzero), $($($cfg)*)*))] + $(#[cfg($($cfg)*)])* impl<'de> Deserialize<'de> for num::$nonzero { fn deserialize(deserializer: D) -> Result where diff --git a/serde/src/ser/impls.rs b/serde/src/ser/impls.rs index f856b6c0..72933909 100644 --- a/serde/src/ser/impls.rs +++ b/serde/src/ser/impls.rs @@ -536,7 +536,6 @@ where macro_rules! nonzero_integers { ($($T:ident,)+) => { $( - #[cfg(not(no_num_nonzero))] impl Serialize for num::$T { fn serialize(&self, serializer: S) -> Result where