Delete support for compilers without NonZero integer types
This commit is contained in:
parent
92e91b3557
commit
a57a324d72
10
.github/workflows/ci.yml
vendored
10
.github/workflows/ci.yml
vendored
@ -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
|
||||
|
@ -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.**
|
||||
|
@ -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" }
|
||||
|
@ -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
|
||||
|
@ -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<D>(deserializer: D) -> Result<Self, D::Error>
|
||||
where
|
||||
|
@ -536,7 +536,6 @@ where
|
||||
macro_rules! nonzero_integers {
|
||||
($($T:ident,)+) => {
|
||||
$(
|
||||
#[cfg(not(no_num_nonzero))]
|
||||
impl Serialize for num::$T {
|
||||
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
|
||||
where
|
||||
|
Loading…
Reference in New Issue
Block a user