Delete support for compilers without core::ops::Bound

This commit is contained in:
David Tolnay 2023-07-30 20:55:29 -07:00
parent 4f59cd217a
commit 1b14cadf20
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
7 changed files with 6 additions and 21 deletions

View File

@ -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

View File

@ -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.**

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.25"
rust-version = "1.26"
[dependencies]
serde_derive = { version = "=1.0.179", optional = true, path = "../serde_derive" }

View File

@ -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
//

View File

@ -2666,7 +2666,6 @@ mod range_to {
////////////////////////////////////////////////////////////////////////////////
#[cfg(any(not(no_ops_bound), feature = "std"))]
impl<'de, T> Deserialize<'de> for Bound<T>
where
T: Deserialize<'de>,

View File

@ -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;

View File

@ -310,7 +310,6 @@ where
////////////////////////////////////////////////////////////////////////////////
#[cfg(any(not(no_ops_bound), feature = "std"))]
impl<T> Serialize for Bound<T>
where
T: Serialize,