From 1b14cadf20fb85d5689fe8046a5356e2f7979055 Mon Sep 17 00:00:00 2001 From: David Tolnay Date: Sun, 30 Jul 2023 20:55:29 -0700 Subject: [PATCH] Delete support for compilers without core::ops::Bound --- .github/workflows/ci.yml | 2 +- README.md | 6 +++--- serde/Cargo.toml | 2 +- serde/build.rs | 7 ------- serde/src/de/impls.rs | 1 - serde/src/lib.rs | 8 +------- serde/src/ser/impls.rs | 1 - 7 files changed, 6 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0275ea87..6b67dbe3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -77,7 +77,7 @@ jobs: strategy: fail-fast: false matrix: - rust: [1.25.0, 1.26.0, 1.34.0] + rust: [1.26.0, 1.34.0] timeout-minutes: 45 steps: - uses: actions/checkout@v3 diff --git a/README.md b/README.md index 74e0ee98..0ad018e3 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ -# Serde   [![Build Status]][actions] [![Latest Version]][crates.io] [![serde: rustc 1.25+]][Rust 1.25] [![serde_derive: rustc 1.56+]][Rust 1.56] +# Serde   [![Build Status]][actions] [![Latest Version]][crates.io] [![serde: rustc 1.26+]][Rust 1.26] [![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.25+]: https://img.shields.io/badge/serde-rustc_1.25+-lightgray.svg +[serde: rustc 1.26+]: https://img.shields.io/badge/serde-rustc_1.26+-lightgray.svg [serde_derive: rustc 1.56+]: https://img.shields.io/badge/serde_derive-rustc_1.56+-lightgray.svg -[Rust 1.25]: https://blog.rust-lang.org/2018/03/29/Rust-1.25.html +[Rust 1.26]: https://blog.rust-lang.org/2018/05/10/Rust-1.26.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 53e4d414..65d59b49 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.25" +rust-version = "1.26" [dependencies] serde_derive = { version = "=1.0.179", optional = true, path = "../serde_derive" } diff --git a/serde/build.rs b/serde/build.rs index fd03d042..1eab424f 100644 --- a/serde/build.rs +++ b/serde/build.rs @@ -16,13 +16,6 @@ fn main() { let target = env::var("TARGET").unwrap(); let emscripten = target == "asmjs-unknown-emscripten" || target == "wasm32-unknown-emscripten"; - // std::collections::Bound was stabilized in Rust 1.17 - // but it was moved to core::ops later in Rust 1.26: - // https://doc.rust-lang.org/core/ops/enum.Bound.html - if minor < 26 { - println!("cargo:rustc-cfg=no_ops_bound"); - } - // 128-bit integers stabilized in Rust 1.26: // https://blog.rust-lang.org/2018/05/10/Rust-1.26.html // diff --git a/serde/src/de/impls.rs b/serde/src/de/impls.rs index 0102a7ab..acb251f7 100644 --- a/serde/src/de/impls.rs +++ b/serde/src/de/impls.rs @@ -2666,7 +2666,6 @@ mod range_to { //////////////////////////////////////////////////////////////////////////////// -#[cfg(any(not(no_ops_bound), feature = "std"))] impl<'de, T> Deserialize<'de> for Bound where T: Deserialize<'de>, diff --git a/serde/src/lib.rs b/serde/src/lib.rs index 0ef1b6c5..ec4e1ba1 100644 --- a/serde/src/lib.rs +++ b/serde/src/lib.rs @@ -183,7 +183,7 @@ mod lib { pub use self::core::fmt::{self, Debug, Display}; pub use self::core::marker::{self, PhantomData}; pub use self::core::num::Wrapping; - pub use self::core::ops::{Range, RangeFrom, RangeTo}; + pub use self::core::ops::{Bound, Range, RangeFrom, RangeTo}; pub use self::core::option::{self, Option}; pub use self::core::result::{self, Result}; pub use self::core::time::Duration; @@ -251,12 +251,6 @@ mod lib { #[cfg(feature = "std")] pub use std::time::{SystemTime, UNIX_EPOCH}; - #[cfg(all(feature = "std", no_ops_bound))] - pub use std::collections::Bound; - - #[cfg(not(no_ops_bound))] - pub use self::core::ops::Bound; - #[cfg(not(no_range_inclusive))] pub use self::core::ops::RangeInclusive; diff --git a/serde/src/ser/impls.rs b/serde/src/ser/impls.rs index 9469e714..c2f9e78b 100644 --- a/serde/src/ser/impls.rs +++ b/serde/src/ser/impls.rs @@ -310,7 +310,6 @@ where //////////////////////////////////////////////////////////////////////////////// -#[cfg(any(not(no_ops_bound), feature = "std"))] impl Serialize for Bound where T: Serialize,