Skip to content

Commit a3162ea

Browse files
committed
Bump MSRV to Rust 1.48.0
As we are doing throughout the rust-bitcoin ecosystem; bump the MSRV to Rust 1.48.0
1 parent 5962169 commit a3162ea

File tree

6 files changed

+31
-42
lines changed

6 files changed

+31
-42
lines changed

.github/workflows/rust.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
- name: Running test script
1818
env:
1919
DO_LINT: true
20+
DO_FEATURE_MATRIX: true
2021
run: ./contrib/test.sh
2122

2223
Beta:
@@ -48,15 +49,15 @@ jobs:
4849
run: ./contrib/test.sh
4950

5051
MSRV:
51-
name: Test - 1.41.1 toolchain
52+
name: Test - 1.48.0 toolchain
5253
runs-on: ubuntu-latest
5354
strategy:
5455
fail-fast: false
5556
steps:
5657
- name: Checkout Crate
5758
uses: actions/checkout@v3
5859
- name: Checkout Toolchain
59-
uses: dtolnay/rust-toolchain@1.41.1
60+
uses: dtolnay/rust-toolchain@1.48.0
6061
- name: Running test script
6162
run: ./contrib/test.sh
6263

Cargo.toml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ default = ["std"]
1616
std = ["alloc"]
1717
alloc = []
1818

19-
# Only for CI to make all warnings errors, do not activate otherwise (may break forward compatibility)
20-
strict = []
21-
2219
[dependencies.arrayvec]
2320
version = "0.7.1"
2421
default-features = false

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,4 @@ Bitcoin-specific address encoding is handled by the `bitcoin-bech32` crate.
1313

1414
## MSRV
1515

16-
The minimum supported Rust version with the standard library is **1.41.1**.
17-
16+
This library should always compile with any combination of features on **Rust 1.48.0**.

clippy.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
msrv = "1.41.1"
1+
msrv = "1.48.0"

contrib/test.sh

Lines changed: 26 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,28 @@
11
#!/bin/sh
22
#
33
# CI test script for rust-bech32.
4-
#
5-
# The "strict" feature is used to configure cargo to deny all warnings, always use it in test runs.
64

75
set -eu
86
set -x
97

8+
# "arrayvec" feature breaks the MSRV, its added manually in DO_FEATURE_MATRIX loop below.
9+
FEATURES="std alloc"
10+
1011
# Some tests require certain toolchain types.
1112
NIGHTLY=false
12-
MIN_VERSION=false
13+
MSRV=false
1314
if cargo --version | grep nightly; then
1415
NIGHTLY=true
1516
fi
16-
if cargo --version | grep 1.41; then
17-
MIN_VERSION=true
17+
if cargo --version | grep "1\.48"; then
18+
MSRV=true
1819
fi
1920

21+
build_and_test () {
22+
cargo build --no-default-features --features="$1"
23+
cargo test --no-default-features --features="$1"
24+
}
25+
2026
# Sanity, check tools exist.
2127
cargo --version
2228
rustc --version
@@ -37,34 +43,21 @@ if [ "${DO_FMT-false}" = true ]; then
3743
cargo fmt --check
3844
fi
3945

40-
check () {
41-
cargo build --no-default-features --features="strict $1"
42-
cargo test --no-default-features --features="strict $1"
43-
}
44-
45-
# Check without features ("strict" is a CI feature only, see above).
46-
check ""
47-
48-
# Check "arrayvec" feature alone.
49-
if [ "$MIN_VERSION" != true ]; then
50-
check "arrayvec"
51-
fi
52-
53-
# Check "alloc" feature alone.
54-
check "alloc"
55-
56-
# Check "alloc" & "arrayvec" features together.
57-
if [ "$MIN_VERSION" != true ]; then
58-
check "alloc arrayvec"
59-
fi
60-
61-
# Check "std" feature (implies "alloc", so this is equivalent to --all-features).
62-
cargo build --no-default-features --features="std"
63-
cargo test --no-default-features --features="std"
64-
65-
# Check "std" & "arrayvec" features together.
66-
if [ "$MIN_VERSION" != true ]; then
67-
check "std arrayvec"
46+
if [ "${DO_FEATURE_MATRIX-false}" = true ]; then
47+
# No features
48+
build_and_test ""
49+
50+
# Feature combos
51+
build_and_test "std"
52+
build_and_test "alloc"
53+
build_and_test "std alloc"
54+
# arrayvec breaks the MSRV
55+
if [ $MSRV = false
56+
]; then
57+
build_and_test "arrayvec"
58+
build_and_test "std arrayvec"
59+
build_and_test "alloc arrayvec"
60+
fi
6861
fi
6962

7063
exit 0

src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ assert_eq!(variant, Variant::Bech32);
3737
#![deny(non_camel_case_types)]
3838
#![deny(non_snake_case)]
3939
#![deny(unused_mut)]
40-
#![cfg_attr(feature = "strict", deny(warnings))]
4140
#![cfg_attr(all(not(feature = "std"), not(test)), no_std)]
4241

4342
#[cfg(feature = "alloc")]

0 commit comments

Comments
 (0)