diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6b67dbe3..cc9a693f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,18 +72,12 @@ jobs: if: matrix.os != 'windows' build: - name: Rust ${{matrix.rust}} + name: Rust 1.34.0 runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - rust: [1.26.0, 1.34.0] timeout-minutes: 45 steps: - uses: actions/checkout@v3 - - uses: dtolnay/rust-toolchain@master - with: - toolchain: ${{matrix.rust}} + - uses: dtolnay/rust-toolchain@1.34.0 - run: cd serde && cargo build --features rc - run: cd serde && cargo build --no-default-features - run: cd serde && cargo build diff --git a/README.md b/README.md index 0ad018e3..6109fdf7 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ -# Serde   [![Build Status]][actions] [![Latest Version]][crates.io] [![serde: rustc 1.26+]][Rust 1.26] [![serde_derive: rustc 1.56+]][Rust 1.56] +# Serde   [![Build Status]][actions] [![Latest Version]][crates.io] [![serde: rustc 1.27+]][Rust 1.27] [![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.26+]: https://img.shields.io/badge/serde-rustc_1.26+-lightgray.svg +[serde: rustc 1.27+]: https://img.shields.io/badge/serde-rustc_1.27+-lightgray.svg [serde_derive: rustc 1.56+]: https://img.shields.io/badge/serde_derive-rustc_1.56+-lightgray.svg -[Rust 1.26]: https://blog.rust-lang.org/2018/05/10/Rust-1.26.html +[Rust 1.27]: https://blog.rust-lang.org/2018/06/21/Rust-1.27.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 65d59b49..6d7a849e 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.26" +rust-version = "1.27" [dependencies] serde_derive = { version = "=1.0.179", optional = true, path = "../serde_derive" } diff --git a/serde/build.rs b/serde/build.rs index 48e52893..ecbb96a6 100644 --- a/serde/build.rs +++ b/serde/build.rs @@ -16,12 +16,9 @@ fn main() { let target = env::var("TARGET").unwrap(); let emscripten = target == "asmjs-unknown-emscripten" || target == "wasm32-unknown-emscripten"; - // Inclusive ranges methods stabilized in Rust 1.27: - // https://github.com/rust-lang/rust/pull/50758 - // Also Iterator::try_for_each: + // Iterator::try_for_each stabilized in Rust 1.27: // https://blog.rust-lang.org/2018/06/21/Rust-1.27.html#library-stabilizations if minor < 27 { - println!("cargo:rustc-cfg=no_range_inclusive"); println!("cargo:rustc-cfg=no_iterator_try_fold"); } diff --git a/serde/src/de/impls.rs b/serde/src/de/impls.rs index acb251f7..124251de 100644 --- a/serde/src/de/impls.rs +++ b/serde/src/de/impls.rs @@ -2238,7 +2238,6 @@ where } } -#[cfg(not(no_range_inclusive))] impl<'de, Idx> Deserialize<'de> for RangeInclusive where Idx: Deserialize<'de>, diff --git a/serde/src/lib.rs b/serde/src/lib.rs index ec4e1ba1..ea0fa472 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::{Bound, Range, RangeFrom, RangeTo}; + pub use self::core::ops::{Bound, Range, RangeFrom, RangeInclusive, RangeTo}; pub use self::core::option::{self, Option}; pub use self::core::result::{self, Result}; pub use self::core::time::Duration; @@ -251,9 +251,6 @@ mod lib { #[cfg(feature = "std")] pub use std::time::{SystemTime, UNIX_EPOCH}; - #[cfg(not(no_range_inclusive))] - pub use self::core::ops::RangeInclusive; - #[cfg(all(feature = "std", no_target_has_atomic, not(no_std_atomic)))] pub use std::sync::atomic::{ AtomicBool, AtomicI16, AtomicI32, AtomicI8, AtomicIsize, AtomicU16, AtomicU32, AtomicU8, diff --git a/serde/src/ser/impls.rs b/serde/src/ser/impls.rs index c2f9e78b..f856b6c0 100644 --- a/serde/src/ser/impls.rs +++ b/serde/src/ser/impls.rs @@ -274,7 +274,6 @@ where //////////////////////////////////////////////////////////////////////////////// -#[cfg(not(no_range_inclusive))] impl Serialize for RangeInclusive where Idx: Serialize,