From 8c18cab28218de4c8b255c8056ad7125d1e19b07 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 8 May 2024 09:03:14 -0700 Subject: [PATCH 1/5] Bump MSRV to 1.60 --- .github/workflows/ci.yaml | 25 ++++------------------- .github/workflows/master.yaml | 2 +- .github/workflows/pr.yaml | 2 +- Cargo.toml | 7 +++++-- README.md | 4 ++-- ci/rustup.sh | 2 +- ci/test_full.sh | 38 ++++++++++++++--------------------- src/lib.rs | 2 +- 8 files changed, 30 insertions(+), 52 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a948577b9..3890f470e 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -9,8 +9,7 @@ jobs: strategy: matrix: rust: [ - 1.31.0, # 2018! - 1.36.0, # alloc, rand + 1.60.0, # MSRV stable, beta, nightly @@ -29,8 +28,8 @@ jobs: - run: ./ci/test_full.sh # try a target that doesn't have std at all, but does have alloc - no_std_stable: - name: No Std (stable) + no_std: + name: No Std runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -39,22 +38,6 @@ jobs: target: thumbv6m-none-eabi - run: cargo build --target thumbv6m-none-eabi --no-default-features --features "alloc libm serde rand" - # try a target that doesn't have std at all, nor alloc - no_std_131: - name: No Std (1.31.0) - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: actions/cache@v4 - with: - path: ~/.cargo/registry/index - key: cargo-1.31.0-git-index - - uses: dtolnay/rust-toolchain@1.31.0 - with: - target: thumbv6m-none-eabi - - run: cargo generate-lockfile && cargo update -p libm --precise 0.2.5 - - run: cargo build --target thumbv6m-none-eabi --no-default-features --features "libm" - fmt: name: Format runs-on: ubuntu-latest @@ -70,7 +53,7 @@ jobs: success: name: Success runs-on: ubuntu-latest - needs: [test, no_std_131, no_std_stable, fmt] + needs: [test, no_std, fmt] # Github branch protection is exceedingly silly and treats "jobs skipped because a dependency # failed" as success. So we have to do some contortions to ensure the job fails if any of its # dependencies fails. diff --git a/.github/workflows/master.yaml b/.github/workflows/master.yaml index 68c4900de..034e37936 100644 --- a/.github/workflows/master.yaml +++ b/.github/workflows/master.yaml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - rust: [1.31.0, stable] + rust: [1.60.0, stable] steps: - uses: actions/checkout@v4 - uses: actions/cache@v4 diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml index 787f90816..baac64847 100644 --- a/.github/workflows/pr.yaml +++ b/.github/workflows/pr.yaml @@ -9,7 +9,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - rust: [1.31.0, stable] + rust: [1.60.0, stable] steps: - uses: actions/checkout@v4 - uses: actions/cache@v4 diff --git a/Cargo.toml b/Cargo.toml index 06575a1c8..e0b8e5a30 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,6 +12,7 @@ version = "0.4.2" readme = "README.md" exclude = ["/ci/*", "/.github/*"] edition = "2018" +rust-version = "1.60" [package.metadata.docs.rs] features = ["std", "serde", "rand"] @@ -54,8 +55,10 @@ features = ["i128"] [features] default = ["std"] +num-bigint = ["dep:num-bigint"] + std = [ - "num-bigint/std", + "dep:num-bigint", "num-bigint/std", "num-complex/std", "num-integer/std", "num-iter/std", @@ -63,7 +66,7 @@ std = [ "num-traits/std", ] -alloc = ["num-bigint", "num-rational/num-bigint"] +alloc = ["dep:num-bigint", "num-rational/num-bigint"] libm = [ "num-complex/libm", diff --git a/README.md b/README.md index 0753d24f7..f9ab46cfc 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![crate](https://img.shields.io/crates/v/num.svg)](https://crates.io/crates/num) [![documentation](https://docs.rs/num/badge.svg)](https://docs.rs/num) -[![minimum rustc 1.31](https://img.shields.io/badge/rustc-1.31+-red.svg)](https://rust-lang.github.io/rfcs/2495-min-rust-version.html) +[![minimum rustc 1.60](https://img.shields.io/badge/rustc-1.60+-red.svg)](https://rust-lang.github.io/rfcs/2495-min-rust-version.html) [![build status](https://github.com/rust-num/num/workflows/master/badge.svg)](https://github.com/rust-num/num/actions) A collection of numeric types and traits for Rust. @@ -69,7 +69,7 @@ Release notes are available in [RELEASES.md](RELEASES.md). ## Compatibility -The `num` crate as a whole is tested for rustc 1.31 and greater. +The `num` crate as a whole is tested for rustc 1.60 and greater. The `num-traits`, `num-integer`, and `num-iter` crates are individually tested for rustc 1.8 and greater, if you require such older compatibility. diff --git a/ci/rustup.sh b/ci/rustup.sh index e59257bce..6cfe67ef0 100755 --- a/ci/rustup.sh +++ b/ci/rustup.sh @@ -5,6 +5,6 @@ set -ex ci=$(dirname $0) -for version in 1.31.0 1.36.0 stable beta nightly; do +for version in 1.60.0 stable beta nightly; do rustup run "$version" "$ci/test_full.sh" done diff --git a/ci/test_full.sh b/ci/test_full.sh index f43635be9..6a361e07f 100755 --- a/ci/test_full.sh +++ b/ci/test_full.sh @@ -3,7 +3,7 @@ set -e CRATE=num -MSRV=1.31 +MSRV=1.60 get_rust_version() { local array=($(rustc --version)); @@ -27,21 +27,15 @@ if ! check_version $MSRV ; then exit 1 fi -STD_FEATURES=(libm serde) +STD_FEATURES=(libm serde rand) +ALLOC_FEATURES=(libm serde rand) NO_STD_FEATURES=(libm) -check_version 1.36 && STD_FEATURES+=(rand) -check_version 1.36 && ALLOC_FEATURES=(libm serde rand) echo "Testing supported features: ${STD_FEATURES[*]}" +echo " alloc supported features: ${ALLOC_FEATURES[*]}" echo " no_std supported features: ${NO_STD_FEATURES[*]}" -if [ -n "${ALLOC_FEATURES[*]}" ]; then - echo " alloc supported features: ${ALLOC_FEATURES[*]}" -fi cargo generate-lockfile -# libm 0.2.6 started using {float}::EPSILON -check_version 1.43 || cargo update -p libm --precise 0.2.5 - set -x # test the default with std @@ -74,18 +68,16 @@ cargo build --no-default-features --features="${NO_STD_FEATURES[*]}" cargo test --no-default-features --features="${NO_STD_FEATURES[*]}" -if [ -n "${ALLOC_FEATURES[*]}" ]; then - # test minimal with alloc - cargo build --no-default-features --features="alloc" - cargo test --no-default-features --features="alloc" +# test minimal with alloc +cargo build --no-default-features --features="alloc" +cargo test --no-default-features --features="alloc" - # test each isolated feature with alloc - for feature in ${ALLOC_FEATURES[*]}; do - cargo build --no-default-features --features="alloc $feature" - cargo test --no-default-features --features="alloc $feature" - done +# test each isolated feature with alloc +for feature in ${ALLOC_FEATURES[*]}; do + cargo build --no-default-features --features="alloc $feature" + cargo test --no-default-features --features="alloc $feature" +done - # test all supported features with alloc - cargo build --no-default-features --features="alloc ${ALLOC_FEATURES[*]}" - cargo test --no-default-features --features="alloc ${ALLOC_FEATURES[*]}" -fi +# test all supported features with alloc +cargo build --no-default-features --features="alloc ${ALLOC_FEATURES[*]}" +cargo test --no-default-features --features="alloc ${ALLOC_FEATURES[*]}" diff --git a/src/lib.rs b/src/lib.rs index f5c6535de..34b247fbd 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -54,7 +54,7 @@ //! //! ## Compatibility //! -//! The `num` crate is tested for rustc 1.31 and greater. +//! The `num` crate is tested for rustc 1.60 and greater. #![doc(html_root_url = "https://docs.rs/num/0.4")] #![no_std] From 99405993b193a748e95fc638dd3ad5d302c2e131 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 8 May 2024 09:04:01 -0700 Subject: [PATCH 2/5] Use the latest version of all num crates --- Cargo.toml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e0b8e5a30..4c800b92d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,12 +23,12 @@ travis-ci = { repository = "rust-num/num" } [dependencies] [dependencies.num-bigint] -optional = true # needs std until Rust 1.36 -version = "0.4.4" +optional = true +version = "0.4.5" default-features = false [dependencies.num-complex] -version = "0.4.5" +version = "0.4.6" default-features = false [dependencies.num-integer] @@ -37,16 +37,16 @@ default-features = false features = ["i128"] [dependencies.num-iter] -version = "0.1.44" +version = "0.1.45" default-features = false features = ["i128"] [dependencies.num-rational] -version = "0.4.1" +version = "0.4.2" default-features = false [dependencies.num-traits] -version = "0.2.18" +version = "0.2.19" default-features = false features = ["i128"] From 6585c6815d3c98477920a123a8a7034b6125f08f Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 8 May 2024 09:05:16 -0700 Subject: [PATCH 3/5] Upgrade to 2021 edition --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 4c800b92d..585bef0f0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ name = "num" version = "0.4.2" readme = "README.md" exclude = ["/ci/*", "/.github/*"] -edition = "2018" +edition = "2021" rust-version = "1.60" [package.metadata.docs.rs] From 1edbd36f0665026c81cbb927418376bbd31e54ef Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 8 May 2024 09:06:53 -0700 Subject: [PATCH 4/5] Release 0.4.3 --- Cargo.toml | 2 +- RELEASES.md | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 585bef0f0..1935eed0c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ categories = [ "algorithms", "data-structures", "science", "no-std" ] license = "MIT OR Apache-2.0" repository = "https://github.com/rust-num/num" name = "num" -version = "0.4.2" +version = "0.4.3" readme = "README.md" exclude = ["/ci/*", "/.github/*"] edition = "2021" diff --git a/RELEASES.md b/RELEASES.md index c32baea96..4fcb1a45a 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1,3 +1,8 @@ +# Release 0.4.3 (2024-05-08) + +- Upgrade to 2021 edition, **MSRV 1.60**. +- Updated all sub-crates to their latest versions. + # Release 0.4.2 (2024-04-12) - Updated all sub-crates to their latest versions. From 43bfc6bdad151d77a86b1218b5c93f2cdc91755f Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Wed, 8 May 2024 09:15:14 -0700 Subject: [PATCH 5/5] Remove old travis-ci metadata --- Cargo.toml | 3 --- 1 file changed, 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 1935eed0c..ac07a38df 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -17,9 +17,6 @@ rust-version = "1.60" [package.metadata.docs.rs] features = ["std", "serde", "rand"] -[badges] -travis-ci = { repository = "rust-num/num" } - [dependencies] [dependencies.num-bigint]