Skip to content

Commit 6e86a2c

Browse files
committed
Use namespaced-features to safely bump to MSRV 1.60
Earlier versions won't see the incompatible updates at all!
1 parent e9b204c commit 6e86a2c

File tree

8 files changed

+20
-33
lines changed

8 files changed

+20
-33
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,7 @@ jobs:
99
strategy:
1010
matrix:
1111
rust: [
12-
1.31.0, # 2018!
13-
1.34.0, # has_try_from
14-
1.36.0, # alloc, rand
15-
1.40.0, # arbitrary
16-
1.46.0, # quickcheck
12+
1.60.0, # MSRV
1713
stable,
1814
beta,
1915
nightly

.github/workflows/master.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
runs-on: ubuntu-latest
1414
strategy:
1515
matrix:
16-
rust: [1.31.0, stable]
16+
rust: [1.60.0, stable]
1717
steps:
1818
- uses: actions/checkout@v4
1919
- uses: actions/cache@v4

.github/workflows/pr.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
runs-on: ubuntu-latest
1010
strategy:
1111
matrix:
12-
rust: [1.31.0, stable]
12+
rust: [1.60.0, stable]
1313
steps:
1414
- uses: actions/checkout@v4
1515
- uses: actions/cache@v4

Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,15 @@ readme = "README.md"
1313
build = "build.rs"
1414
exclude = ["/ci/*", "/.github/*"]
1515
edition = "2018"
16+
rust-version = "1.60"
1617

1718
[features]
1819
default = ["std"]
1920
std = ["num-integer/std", "num-traits/std"]
21+
arbitrary = ["dep:arbitrary"]
22+
quickcheck = ["dep:quickcheck"]
23+
rand = ["dep:rand"]
24+
serde = ["dep:serde"]
2025

2126
[package.metadata.docs.rs]
2227
features = ["std", "serde", "rand", "quickcheck", "arbitrary"]

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
[![crate](https://img.shields.io/crates/v/num-bigint.svg)](https://crates.io/crates/num-bigint)
44
[![documentation](https://docs.rs/num-bigint/badge.svg)](https://docs.rs/num-bigint)
5-
[![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)
5+
[![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)
66
[![build status](https://github.com/rust-num/num-bigint/workflows/master/badge.svg)](https://github.com/rust-num/num-bigint/actions)
77

88
Big integer types for Rust, `BigInt` and `BigUint`.
@@ -42,7 +42,7 @@ Release notes are available in [RELEASES.md](RELEASES.md).
4242

4343
## Compatibility
4444

45-
The `num-bigint` crate is tested for rustc 1.31 and greater.
45+
The `num-bigint` crate is tested for rustc 1.60 and greater.
4646

4747
## Alternatives
4848

@@ -52,10 +52,10 @@ table offers a brief comparison to a few alternatives.
5252

5353
| Crate | License | Min rustc | Implementation | Features |
5454
| :--------------- | :------------- | :-------- | :------------- | :------- |
55-
| **`num-bigint`** | MIT/Apache-2.0 | 1.31 | pure rust | dynamic width, number theoretical functions |
55+
| **`num-bigint`** | MIT/Apache-2.0 | 1.60 | pure rust | dynamic width, number theoretical functions |
5656
| [`awint`] | MIT/Apache-2.0 | 1.66 | pure rust | fixed width, heap or stack, concatenation macros |
57-
| [`bnum`] | MIT/Apache-2.0 | 1.61 | pure rust | fixed width, parity with Rust primitives including floats |
58-
| [`crypto-bigint`] | MIT/Apache-2.0 | 1.57 | pure rust | fixed width, stack only |
57+
| [`bnum`] | MIT/Apache-2.0 | 1.65 | pure rust | fixed width, parity with Rust primitives including floats |
58+
| [`crypto-bigint`] | MIT/Apache-2.0 | 1.73 | pure rust | fixed width, stack only |
5959
| [`ibig`] | MIT/Apache-2.0 | 1.49 | pure rust | dynamic width, number theoretical functions |
6060
| [`rug`] | LGPL-3.0+ | 1.65 | bundles [GMP] via [`gmp-mpfr-sys`] | all the features of GMP, MPFR, and MPC |
6161

ci/rustup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
set -ex
66

77
ci=$(dirname $0)
8-
for version in 1.31.0 1.34.0 1.36.0 1.40.0 1.46.0 stable beta nightly; do
8+
for version in 1.60.0 stable beta nightly; do
99
rustup run "$version" "$ci/test_full.sh"
1010
done

ci/test_full.sh

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
set -e
44

55
CRATE=num-bigint
6-
MSRV=1.31
6+
MSRV=1.60
77

88
get_rust_version() {
99
local array=($(rustc --version));
@@ -27,18 +27,15 @@ if ! check_version $MSRV ; then
2727
exit 1
2828
fi
2929

30-
STD_FEATURES=(serde)
31-
check_version 1.36 && STD_FEATURES+=(rand)
32-
check_version 1.36 && NO_STD_FEATURES=(serde rand)
33-
check_version 1.40 && STD_FEATURES+=(arbitrary)
34-
check_version 1.46 && STD_FEATURES+=(quickcheck)
30+
STD_FEATURES=(arbitrary quickcheck rand serde)
31+
NO_STD_FEATURES=(serde rand)
3532
echo "Testing supported features: ${STD_FEATURES[*]}"
3633
if [ -n "${NO_STD_FEATURES[*]}" ]; then
3734
echo " no_std supported features: ${NO_STD_FEATURES[*]}"
3835
fi
3936

40-
# arbitrary 1.0.1 added const-generic arrays, which requires Rust 1.51
41-
check_version 1.51.0 || cargo update -p arbitrary --precise 1.0.0
37+
# arbitrary 1.1.4 started using array::from_fn
38+
check_version 1.63.0 || cargo update -p arbitrary --precise 1.1.3
4239

4340
set -x
4441

@@ -82,22 +79,11 @@ fi
8279
case "${STD_FEATURES[*]}" in
8380
*serde*) (
8481
cd ci/big_serde
85-
# serde_test updated to 2021 edition after this version
86-
check_version 1.56.0 || (
87-
cargo generate-lockfile
88-
cargo update -p serde_test --precise 1.0.175
89-
)
9082
cargo test
9183
) ;;&
9284
*rand*) cargo test --manifest-path ci/big_rand/Cargo.toml ;;&
9385
*quickcheck*) (
9486
cd ci/big_quickcheck
95-
# quote and proc-macro2 updated to 2021 edition after these versions
96-
check_version 1.56.0 || (
97-
cargo generate-lockfile
98-
cargo update -p quote --precise 1.0.30
99-
cargo update -p proc-macro2 --precise 1.0.65
100-
)
10187
cargo test
10288
) ;;&
10389
esac

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
//!
8282
//! ## Compatibility
8383
//!
84-
//! The `num-bigint` crate is tested for rustc 1.31 and greater.
84+
//! The `num-bigint` crate is tested for rustc 1.60 and greater.
8585
8686
#![doc(html_root_url = "https://docs.rs/num-bigint/0.4")]
8787
#![warn(rust_2018_idioms)]

0 commit comments

Comments
 (0)