Skip to content

Commit 8426b3b

Browse files
committed
Bump MSRV to rustc 1.75.0
We generally align our MSRV with Debian's stable channel. Debian 13 'Trixie' was just released, shipping rustc 1.85. However, as 1.85.0 is only about ~7months old at this point, we opt to bump to the more conservative 1.75.0, which approaches two years of age.
1 parent 867f084 commit 8426b3b

File tree

8 files changed

+14
-45
lines changed

8 files changed

+14
-45
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ jobs:
3131
fail-fast: false
3232
matrix:
3333
platform: [ self-hosted, windows-latest, macos-latest ]
34-
toolchain: [ stable, beta, 1.63.0 ] # 1.63.0 is the MSRV for all crates but `lightning-transaction-sync`.
34+
toolchain: [ stable, beta, 1.75.0 ] # 1.75.0 is the MSRV for all crates
3535
exclude:
3636
- platform: windows-latest
37-
toolchain: 1.63.0
37+
toolchain: 1.75.0
3838
- platform: windows-latest
3939
toolchain: beta
4040
- platform: macos-latest
@@ -60,7 +60,7 @@ jobs:
6060
shellcheck ci/*.sh -aP ci
6161
shellcheck contrib/*.sh -aP contrib
6262
- name: Set RUSTFLAGS to deny warnings
63-
if: "matrix.toolchain == '1.63.0'"
63+
if: "matrix.toolchain == '1.75.0'"
6464
run: echo "RUSTFLAGS=-D warnings" >> "$GITHUB_ENV"
6565
- name: Run CI script
6666
shell: bash # Default on Winblows is powershell
@@ -71,7 +71,7 @@ jobs:
7171
fail-fast: false
7272
matrix:
7373
platform: [ ubuntu-latest, macos-latest ]
74-
toolchain: [ stable, beta, 1.75.0 ] # 1.75.0 is the MSRV for `lightning-transaction-sync`.
74+
toolchain: [ stable, beta, 1.75.0 ]
7575
runs-on: ${{ matrix.platform }}
7676
steps:
7777
- name: Checkout source code
@@ -236,17 +236,13 @@ jobs:
236236
fuzz:
237237
runs-on: self-hosted
238238
env:
239-
TOOLCHAIN: 1.63
239+
TOOLCHAIN: 1.75
240240
steps:
241241
- name: Checkout source code
242242
uses: actions/checkout@v4
243243
- name: Install Rust ${{ env.TOOLCHAIN }} toolchain
244244
run: |
245245
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile=minimal --default-toolchain ${{ env.TOOLCHAIN }}
246-
- name: Pin the regex dependency
247-
run: |
248-
cd fuzz && cargo update -p regex --precise "1.9.6" --verbose
249-
cd write-seeds && cargo update -p regex --precise "1.9.6" --verbose
250246
- name: Sanity check fuzz targets on Rust ${{ env.TOOLCHAIN }}
251247
run: |
252248
cd fuzz
@@ -275,7 +271,7 @@ jobs:
275271
rustfmt:
276272
runs-on: ubuntu-latest
277273
env:
278-
TOOLCHAIN: 1.63.0
274+
TOOLCHAIN: 1.75.0
279275
steps:
280276
- name: Checkout source code
281277
uses: actions/checkout@v4

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ be covered by functional tests.
8888
When refactoring, structure your PR to make it easy to review and don't
8989
hesitate to split it into multiple small, focused PRs.
9090

91-
The Minimum Supported Rust Version (MSRV) currently is 1.63.0 (enforced by
91+
The Minimum Supported Rust Version (MSRV) currently is 1.75.0 (enforced by
9292
our GitHub Actions). We support reading serialized LDK objects written by any
9393
version of LDK 0.0.99 and above. We support LDK versions 0.0.113 and above
9494
reading serialized LDK objects written by modern LDK. Any expected issues with
@@ -124,7 +124,7 @@ display fine at any tab-length display setting. We use `rustfmt` to establish
124124
uniform coding standards throughout the codebase. Please run
125125

126126
```bash
127-
cargo +1.63.0 fmt
127+
cargo +1.75.0 fmt
128128
```
129129

130130
before committing and pushing any changes, as compliance will also be checked

ci/check-lint.sh

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ CLIPPY() {
4747
-A clippy::len_without_is_empty \
4848
-A clippy::len_zero \
4949
-A clippy::let_and_return \
50-
-A clippy::manual_div_ceil `# to be removed once we hit MSRV 1.73.0` \
5150
-A clippy::manual_filter \
5251
-A clippy::manual_map \
5352
-A clippy::manual_memcpy \
@@ -106,9 +105,7 @@ CLIPPY() {
106105
-A clippy::unnecessary_unwrap \
107106
-A clippy::unused_unit \
108107
-A clippy::useless_conversion \
109-
-A clippy::unnecessary_map_or `# to be removed once we hit MSRV 1.70` \
110108
-A clippy::manual_repeat_n `# to be removed once we hit MSRV 1.86` \
111-
-A clippy::io_other_error `# to be removed once we hit MSRV 1.74` \
112109
-A clippy::uninlined-format-args
113110
}
114111

ci/ci-tests.sh

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,18 @@
11
#!/bin/bash
22
set -eox pipefail
33

4-
RUSTC_MINOR_VERSION=$(rustc --version | awk '{ split($2,a,"."); print a[2] }')
4+
# Currently unused as we don't have to pin anything for MSRV:
5+
#RUSTC_MINOR_VERSION=$(rustc --version | awk '{ split($2,a,"."); print a[2] }')
56

67
# Some crates require pinning to meet our MSRV even for our downstream users,
78
# which we do here.
89
# Further crates which appear only as dev-dependencies are pinned further down.
910
function PIN_RELEASE_DEPS {
10-
# Starting with version 1.39.0, the `tokio` crate has an MSRV of rustc 1.70.0
11-
[ "$RUSTC_MINOR_VERSION" -lt 70 ] && cargo update -p tokio --precise "1.38.1" --verbose
12-
1311
return 0 # Don't fail the script if our rustc is higher than the last check
1412
}
1513

1614
PIN_RELEASE_DEPS # pin the release dependencies in our main workspace
1715

18-
# Starting with version 1.10.0, the `regex` crate has an MSRV of rustc 1.65.0.
19-
[ "$RUSTC_MINOR_VERSION" -lt 65 ] && cargo update -p regex --precise "1.9.6" --verbose
20-
21-
# The addr2line v0.21 crate (a dependency of `backtrace` starting with 0.3.69) relies on rustc 1.65
22-
[ "$RUSTC_MINOR_VERSION" -lt 65 ] && cargo update -p backtrace --precise "0.3.68" --verbose
23-
24-
# The once_cell v1.21.0 crate (a dependency of `proptest`) relies on rustc 1.70
25-
[ "$RUSTC_MINOR_VERSION" -lt 70 ] && cargo update -p once_cell --precise "1.20.3" --verbose
26-
27-
# proptest 1.3.0 requires rustc 1.64.0
28-
[ "$RUSTC_MINOR_VERSION" -lt 64 ] && cargo update -p proptest --precise "1.2.0" --verbose
29-
30-
# parking_lot 0.12.4 requires rustc 1.64.0
31-
[ "$RUSTC_MINOR_VERSION" -lt 64 ] && cargo update -p parking_lot --precise "0.12.3" --verbose
32-
33-
# parking_lot_core 0.9.11 requires rustc 1.64.0
34-
[ "$RUSTC_MINOR_VERSION" -lt 64 ] && cargo update -p parking_lot_core --precise "0.9.10" --verbose
35-
36-
# lock_api 0.4.13 requires rustc 1.64.0
37-
[ "$RUSTC_MINOR_VERSION" -lt 64 ] && cargo update -p lock_api --precise "0.4.12" --verbose
38-
3916
export RUST_BACKTRACE=1
4017

4118
echo -e "\n\nChecking the workspace, except lightning-transaction-sync."
@@ -64,7 +41,6 @@ cargo test --verbose --color always
6441

6542
echo -e "\n\nTesting upgrade from prior versions of LDK"
6643
pushd lightning-tests
67-
[ "$RUSTC_MINOR_VERSION" -lt 65 ] && cargo update -p regex --precise "1.9.6" --verbose
6844
cargo test
6945
popd
7046

lightning-invoice/src/de.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ impl FromBase32 for Bolt11InvoiceFeatures {
102102
// Carry bits, 0, 1, 2, 3, or 4 bits
103103
let mut carry_bits = 0;
104104
let mut carry = 0u8;
105-
let expected_raw_length = (field_data.len() * 5 + 7) / 8;
105+
let expected_raw_length = (field_data.len() * 5).div_ceil(8);
106106
let mut output = Vec::<u8>::with_capacity(expected_raw_length);
107107

108108
// Iterate over input in reverse

lightning-invoice/src/ser.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ fn encode_int_be_base32(int: u64) -> impl ExactSizeIterator<Item = Fe32> {
237237
/// The length of the output of `encode_int_be_base32`.
238238
fn encoded_int_be_base32_size(int: u64) -> usize {
239239
let bit_len = 64 - int.leading_zeros() as usize; // cast ok as value is in 0..=64.
240-
(bit_len + 4) / 5
240+
bit_len.div_ceil(5)
241241
}
242242

243243
impl Base32Iterable for RawDataPart {

lightning-types/src/features.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,7 +688,7 @@ mod sealed {
688688
);
689689
// By default, allocate enough bytes to cover up to Splice. Update this as new features are
690690
// added which we expect to appear commonly across contexts.
691-
pub(super) const MIN_FEATURES_ALLOCATION_BYTES: usize = (63 + 7) / 8;
691+
pub(super) const MIN_FEATURES_ALLOCATION_BYTES: usize = 63_usize.div_ceil(8);
692692
define_feature!(
693693
259,
694694
DnsResolver,

rustfmt.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use_small_heuristics = "Max"
2-
fn_args_layout = "Compressed"
2+
fn_params_layout = "Compressed"
33
hard_tabs = true
44
use_field_init_shorthand = true
55
max_width = 100

0 commit comments

Comments
 (0)