Skip to content

Commit 035acdc

Browse files
authored
Increase the MSRV from 1.63 to 1.65 (#1594)
* Increase the MSRV from 1.63 to 1.65 * Disable failing targets * De-duplicate ffi definitions * Reword MSRV section in README * Remove the explicit extern crate
1 parent 9f588bc commit 035acdc

25 files changed

Lines changed: 180 additions & 237 deletions

File tree

.github/workflows/main.yml

Lines changed: 50 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,17 @@ jobs:
2525
runs-on: ${{ matrix.os }}
2626
strategy:
2727
matrix:
28-
build: [stable, nightly, 1.63]
28+
build: [stable, nightly, 1.65]
2929
include:
3030
- build: stable
3131
os: ubuntu-latest
3232
rust: stable
3333
- build: nightly
3434
os: ubuntu-latest
3535
rust: nightly
36-
- build: 1.63
36+
- build: 1.65
3737
os: ubuntu-latest
38-
rust: 1.63
38+
rust: 1.65
3939

4040
env:
4141
# -D warnings is commented out in our install-rust action; re-add it here.
@@ -48,19 +48,16 @@ jobs:
4848
with:
4949
toolchain: ${{ matrix.rust }}
5050

51-
- name: Use specific dependency versions for Rust 1.63 compatibility.
52-
if: matrix.rust == '1.63'
51+
- name: Use specific dependency versions for Rust 1.65 compatibility.
52+
if: matrix.rust == '1.65'
5353
run: |
54-
cargo update --package=dashmap --precise 5.4.0
55-
cargo update --package=regex --precise=1.9.0
5654
cargo update --package=half --precise=2.2.1
5755
cargo update --package=flate2 --precise=1.0.35
5856
cargo update --package=syn --precise=2.0.106
5957
cargo update --package=textwrap --precise=0.16.1
60-
cargo update --package=once_cell --precise=1.20.3
61-
cargo update --package=parking_lot --precise=0.12.3
62-
cargo update --package=parking_lot_core --precise=0.9.10
63-
cargo update --package=lock_api --precise=0.4.12
58+
cargo update --package=parking_lot --precise=0.12.4
59+
cargo update --package=parking_lot_core --precise=0.9.11
60+
cargo update --package=lock_api --precise=0.4.13
6461
cargo update --package=rayon --precise=1.10.0
6562
cargo update --package=rayon-core --precise=1.12.1
6663
cargo update --package=windows-sys --precise=0.60.2
@@ -107,13 +104,13 @@ jobs:
107104
aarch64-linux-android
108105
aarch64-apple-ios
109106
i686-pc-windows-msvc
110-
- if: matrix.rust != '1.63'
107+
- if: matrix.rust != '1.65'
111108
run: >
112109
rustup target add
113110
wasm32-wasip1
114111
wasm32-wasip2
115112
x86_64-unknown-fuchsia
116-
- if: matrix.rust == '1.63'
113+
- if: matrix.rust == '1.65'
117114
run: rustup target add x86_64-fuchsia
118115

119116
- run: cargo check --workspace --release -vv --all-targets
@@ -123,19 +120,20 @@ jobs:
123120
- run: cargo check --workspace --release -vv --target=aarch64-linux-android --all-targets
124121
- run: cargo check --workspace --release -vv --target=x86_64-unknown-linux-musl --features=all-apis --all-targets
125122
- run: cargo check --workspace --release -vv --target=x86_64-unknown-linux-musl --features=use-libc,all-apis --all-targets
126-
- run: cargo check --workspace --release -vv --target=x86_64-unknown-linux-gnux32 --features=all-apis --all-targets
123+
# Temporarily disable due to build errors.
124+
# - run: cargo check --workspace --release -vv --target=x86_64-unknown-linux-gnux32 --features=all-apis --all-targets
127125
- run: cargo check --workspace --release -vv --target=x86_64-linux-android --features=use-libc,net,std,alloc,event,fs,mm,param,pipe,use-libc-auxv,libc_errno --all-targets
128126
- run: cargo check --workspace --release -vv --target=i686-linux-android --features=use-libc,net,std,alloc,event,fs,mm,param,pipe,use-libc-auxv,libc_errno --all-targets
129127
- run: cargo check --workspace --release -vv --target=x86_64-apple-darwin --features=all-apis --all-targets
130128
- run: cargo check --workspace --release -vv --target=x86_64-unknown-freebsd --features=all-apis --all-targets
131129
- run: cargo check --workspace --release -vv --target=x86_64-unknown-netbsd --features=all-apis --all-targets
132-
- if: matrix.rust != '1.63'
130+
- if: matrix.rust != '1.65'
133131
run: cargo check --workspace --release -vv --target=wasm32-wasip1 --features=all-apis
134-
- if: matrix.rust != '1.63'
132+
- if: matrix.rust != '1.65'
135133
run: cargo check --workspace --release -vv --target=wasm32-wasip2 --features=all-apis
136-
- if: matrix.rust != '1.63'
134+
- if: matrix.rust != '1.65'
137135
run: cargo check --workspace --release -vv --target=x86_64-unknown-fuchsia --features=all-apis --all-targets
138-
- if: matrix.rust == '1.63'
136+
- if: matrix.rust == '1.65'
139137
run: cargo check --workspace --release -vv --target=x86_64-fuchsia --features=all-apis --all-targets
140138
- run: cargo check --workspace --release -vv --target=x86_64-unknown-illumos --features=all-apis --all-targets
141139
- run: cargo check --workspace --release -vv --target=i686-unknown-linux-gnu --features=all-apis --all-targets
@@ -239,11 +237,14 @@ jobs:
239237
RUSTFLAGS: -A improper_ctypes_definitions --cfg criterion
240238
- run: rustup component add rust-src
241239
- run: cargo check -Z build-std --target x86_64-unknown-openbsd --all-targets --features=all-apis
242-
- run: cargo check -Z build-std --target mips64-openwrt-linux-musl --all-targets --features=all-apis
240+
# Temporarily disable due to build errors.
241+
# - run: cargo check -Z build-std --target mips64-openwrt-linux-musl --all-targets --features=all-apis
243242
- run: cargo check -Z build-std --target x86_64-unknown-dragonfly --all-targets --features=all-apis
244-
- run: cargo check -Z build-std --target sparc-unknown-linux-gnu --all-targets --features=all-apis
243+
# Temporarily disable due to build errors.
244+
# - run: cargo check -Z build-std --target sparc-unknown-linux-gnu --all-targets --features=all-apis
245245
- run: cargo check -Z build-std --target armv7-unknown-freebsd --all-targets --features=all-apis
246-
- run: cargo check -Z build-std --target aarch64-unknown-linux-gnu_ilp32 --all-targets --features=all-apis
246+
# Temporarily disable due to build errors.
247+
# - run: cargo check -Z build-std --target aarch64-unknown-linux-gnu_ilp32 --all-targets --features=all-apis
247248
- run: cargo check -Z build-std --target x86_64-unknown-haiku --all-targets --features=all-apis
248249
# Temporarily disable due to build errors on nightly.
249250
# - run: cargo check -Z build-std --target x86_64-uwp-windows-msvc --all-targets --features=all-apis
@@ -291,14 +292,14 @@ jobs:
291292
powerpc-linux-stable,
292293
powerpc64le-linux-stable,
293294
arm-linux-stable,
294-
ubuntu-1.63,
295-
i686-linux-1.63,
296-
aarch64-linux-1.63,
297-
riscv64-linux-1.63,
298-
s390x-linux-1.63,
295+
ubuntu-1.65,
296+
i686-linux-1.65,
297+
aarch64-linux-1.65,
298+
riscv64-linux-1.65,
299+
s390x-linux-1.65,
299300
powerpc64le-linux,
300-
powerpc64le-linux-1.63,
301-
arm-linux-1.63,
301+
powerpc64le-linux-1.65,
302+
arm-linux-1.65,
302303
macos-latest,
303304
macos-15-intel,
304305
macos-14,
@@ -437,64 +438,64 @@ jobs:
437438
qemu: qemu-arm
438439
qemu_args: -L /usr/arm-linux-gnueabi
439440
qemu_target: arm-linux-user
440-
- build: ubuntu-1.63
441+
- build: ubuntu-1.65
441442
os: ubuntu-latest
442-
rust: 1.63
443-
- build: i686-linux-1.63
443+
rust: 1.65
444+
- build: i686-linux-1.65
444445
os: ubuntu-latest
445-
rust: 1.63
446+
rust: 1.65
446447
target: i686-unknown-linux-gnu
447448
gcc_package: gcc-i686-linux-gnu
448449
gcc: i686-linux-gnu-gcc
449450
libc_package: libc-dev-i386-cross
450-
- build: aarch64-linux-1.63
451+
- build: aarch64-linux-1.65
451452
os: ubuntu-latest
452-
rust: 1.63
453+
rust: 1.65
453454
target: aarch64-unknown-linux-gnu
454455
gcc_package: gcc-aarch64-linux-gnu
455456
gcc: aarch64-linux-gnu-gcc
456457
qemu: qemu-aarch64
457458
qemu_args: -L /usr/aarch64-linux-gnu
458459
qemu_target: aarch64-linux-user
459-
- build: riscv64-linux-1.63
460+
- build: riscv64-linux-1.65
460461
os: ubuntu-latest
461-
rust: 1.63
462+
rust: 1.65
462463
target: riscv64gc-unknown-linux-gnu
463464
gcc_package: gcc-riscv64-linux-gnu
464465
gcc: riscv64-linux-gnu-gcc
465466
qemu: qemu-riscv64
466467
qemu_args: -L /usr/riscv64-linux-gnu
467468
qemu_target: riscv64-linux-user
468-
- build: s390x-linux-1.63
469+
- build: s390x-linux-1.65
469470
os: ubuntu-latest
470-
rust: 1.63
471+
rust: 1.65
471472
target: s390x-unknown-linux-gnu
472473
gcc_package: gcc-s390x-linux-gnu
473474
gcc: s390x-linux-gnu-gcc
474475
qemu: qemu-s390x
475476
qemu_args: -L /usr/s390x-linux-gnu
476477
qemu_target: s390x-linux-user
477-
- build: powerpc-linux-1.63
478+
- build: powerpc-linux-1.65
478479
os: ubuntu-latest
479-
rust: 1.63
480+
rust: 1.65
480481
target: powerpc-unknown-linux-gnu
481482
gcc_package: gcc-powerpc-linux-gnu
482483
gcc: powerpc-linux-gnu-gcc
483484
qemu: qemu-ppc
484485
qemu_args: -L /usr/powerpc-linux-gnu
485486
qemu_target: ppc-linux-user
486-
- build: powerpc64le-linux-1.63
487+
- build: powerpc64le-linux-1.65
487488
os: ubuntu-latest
488-
rust: 1.63
489+
rust: 1.65
489490
target: powerpc64le-unknown-linux-gnu
490491
gcc_package: gcc-powerpc64le-linux-gnu
491492
gcc: powerpc64le-linux-gnu-gcc
492493
qemu: qemu-ppc64le
493494
qemu_args: -L /usr/powerpc64le-linux-gnu
494495
qemu_target: ppc64le-linux-user
495-
- build: arm-linux-1.63
496+
- build: arm-linux-1.65
496497
os: ubuntu-latest
497-
rust: 1.63
498+
rust: 1.65
498499
target: armv5te-unknown-linux-gnueabi
499500
gcc_package: gcc-arm-linux-gnueabi
500501
gcc: arm-linux-gnueabi-gcc
@@ -585,19 +586,16 @@ jobs:
585586
ninja -C build install
586587
if: matrix.qemu != '' && matrix.os == 'ubuntu-latest'
587588

588-
- name: Use specific dependency versions for Rust 1.63 compatibility.
589-
if: matrix.rust == '1.63'
589+
- name: Use specific dependency versions for Rust 1.65 compatibility.
590+
if: matrix.rust == '1.65'
590591
run: |
591-
cargo update --package=dashmap --precise 5.4.0
592-
cargo update --package=regex --precise=1.9.0
593592
cargo update --package=half --precise=2.2.1
594593
cargo update --package=flate2 --precise=1.0.35
595594
cargo update --package=syn --precise=2.0.106
596595
cargo update --package=textwrap --precise=0.16.1
597-
cargo update --package=once_cell --precise=1.20.3
598-
cargo update --package=parking_lot --precise=0.12.3
599-
cargo update --package=parking_lot_core --precise=0.9.10
600-
cargo update --package=lock_api --precise=0.4.12
596+
cargo update --package=parking_lot --precise=0.12.4
597+
cargo update --package=parking_lot_core --precise=0.9.11
598+
cargo update --package=lock_api --precise=0.4.13
601599
cargo update --package=rayon --precise=1.10.0
602600
cargo update --package=rayon-core --precise=1.12.1
603601
cargo update --package=windows-sys --precise=0.60.2

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ edition = "2021"
1313
keywords = ["api", "file", "network", "safe", "syscall"]
1414
categories = ["os::unix-apis", "date-and-time", "filesystem", "network-programming"]
1515
include = ["src", "build.rs", "Cargo.toml", "COPYRIGHT", "LICENSE*", "/*.md", "benches"]
16-
rust-version = "1.63"
16+
rust-version = "1.65"
1717

1818
[hints]
1919
# Most users use a fraction of the rustix API surface area, so this reduces compilation times
@@ -268,7 +268,6 @@ check-cfg = [
268268
'cfg(rustc_diagnostics)',
269269
'cfg(solarish)',
270270
'cfg(staged_api)',
271-
'cfg(static_assertions)',
272271
'cfg(thumb_mode)',
273272
'cfg(wasi)',
274273
'cfg(wasi_ext)',

README.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ more portable APIs built on this functionality, see the [`cap-std`], [`memfd`],
3333

3434
* linux_raw, which uses raw Linux system calls and vDSO calls, and is
3535
supported on Linux on x86-64, x86, aarch64, riscv64gc, powerpc64le,
36-
arm (v5 onwards), mipsel, and mips64el, with stable, nightly, and 1.63 Rust.
36+
arm (v5 onwards), mipsel, and mips64el, with stable, nightly, and 1.65 Rust.
3737
- By being implemented entirely in Rust, avoiding `libc`, `errno`, and pthread
3838
cancellation, and employing some specialized optimizations, most functions
3939
compile down to very efficient code, which can often be fully inlined into
@@ -155,12 +155,12 @@ safety types rather than `RawFd`, and the flags parameters to functions such as
155155
`tcsetattr` are `enum`s rather than bare integers. And, rustix calls its
156156
`tcgetattr` function `tcgetattr`, rather than `Termios::from_fd`.
157157

158-
## Minimum Supported Rust Version (MSRV)
158+
## Minimum Supported Rust Version
159159

160-
This crate currently works on the version of [Rust on Debian stable], which is
161-
currently [Rust 1.63]. This policy may change in the future, in minor version
162-
releases, so users using a fixed version of Rust should pin to a specific
163-
version of this crate.
160+
This crate has a Minimum Supported Rust Version (MSRV) of [Rust 1.65].
161+
162+
The current policy is that the minimum Rust version required to use this crate
163+
may be increased in minor releases.
164164

165165
## Minimum Linux Version
166166

@@ -171,11 +171,10 @@ oldest Linux version supported by:
171171
The specifics of this policy may change in the future, but we intend it to
172172
always reflect “very old” Linux versions.
173173

174-
[MSRV]: #minimum-supported-rust-version-msrv
175-
[Rust 1.63]: https://blog.rust-lang.org/2022/08/11/Rust-1.63.0.html
174+
[MSRV]: #minimum-supported-rust-version
175+
[Rust 1.65]: https://blog.rust-lang.org/2022/11/03/Rust-1.65.0/
176176
[any current Rust target]: https://doc.rust-lang.org/nightly/rustc/platform-support.html
177177
[kernel.org]: https://www.kernel.org/releases.html
178-
[Rust on Debian stable]: https://packages.debian.org/stable/rust/rustc
179178
[Windows Sockets 2]: https://learn.microsoft.com/en-us/windows/win32/winsock/windows-sockets-start-page-2
180179
[`nix`]: https://crates.io/crates/nix
181180
[`unix`]: https://crates.io/crates/unix

build.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,6 @@ fn main() {
7979
use_feature_or_nothing("error_in_core");
8080
}
8181

82-
// Feature needed for testing.
83-
if use_static_assertions() {
84-
use_feature("static_assertions");
85-
}
86-
8782
// `LowerExp`/`UpperExp` for `NonZeroI32` etc.
8883
if has_lower_upper_exp_for_non_zero() {
8984
use_feature("lower_upper_exp_for_non_zero");
@@ -197,11 +192,6 @@ fn main() {
197192
println!("cargo:rerun-if-env-changed=CARGO_CFG_MIRI");
198193
}
199194

200-
fn use_static_assertions() -> bool {
201-
// `offset_from` was made const in Rust 1.65.
202-
can_compile("const unsafe fn foo(p: *const u8) -> isize { p.offset_from(p) }")
203-
}
204-
205195
fn use_thumb_mode() -> bool {
206196
// In thumb mode, r7 is reserved.
207197
!can_compile("pub unsafe fn f() { core::arch::asm!(\"udf #16\", in(\"r7\") 0); }")

src/backend/libc/fs/dir.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,8 +421,8 @@ fn check_dirent_layout(dirent: &c::dirent) {
421421
// Check that the basic layouts match.
422422
#[cfg(test)]
423423
{
424-
assert_eq_size!(libc_dirent, c::dirent);
425-
assert_eq_size!(libc_dirent, c::dirent);
424+
static_assertions::assert_eq_size!(libc_dirent, c::dirent);
425+
static_assertions::assert_eq_size!(libc_dirent, c::dirent);
426426
}
427427

428428
// Check that the field offsets match.

src/backend/libc/fs/syscalls.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -672,7 +672,7 @@ pub(crate) fn stat(path: &CStr) -> io::Result<Stat> {
672672
)))]
673673
unsafe {
674674
#[cfg(test)]
675-
assert_eq_size!(Stat, c::stat);
675+
static_assertions::assert_eq_size!(Stat, c::stat);
676676

677677
let mut stat = MaybeUninit::<Stat>::uninit();
678678
ret(c::stat(c_str(path), stat.as_mut_ptr().cast()))?;
@@ -718,7 +718,7 @@ pub(crate) fn lstat(path: &CStr) -> io::Result<Stat> {
718718
)))]
719719
unsafe {
720720
#[cfg(test)]
721-
assert_eq_size!(Stat, c::stat);
721+
static_assertions::assert_eq_size!(Stat, c::stat);
722722

723723
let mut stat = MaybeUninit::<Stat>::uninit();
724724
ret(c::lstat(c_str(path), stat.as_mut_ptr().cast()))?;
@@ -760,7 +760,7 @@ pub(crate) fn statat(dirfd: BorrowedFd<'_>, path: &CStr, flags: AtFlags) -> io::
760760
)))]
761761
unsafe {
762762
#[cfg(test)]
763-
assert_eq_size!(Stat, c::stat);
763+
static_assertions::assert_eq_size!(Stat, c::stat);
764764

765765
let mut stat = MaybeUninit::<Stat>::uninit();
766766
ret(c::fstatat(
@@ -1563,7 +1563,7 @@ pub(crate) fn fstat(fd: BorrowedFd<'_>) -> io::Result<Stat> {
15631563
)))]
15641564
unsafe {
15651565
#[cfg(test)]
1566-
assert_eq_size!(Stat, c::stat);
1566+
static_assertions::assert_eq_size!(Stat, c::stat);
15671567

15681568
let mut stat = MaybeUninit::<Stat>::uninit();
15691569
ret(c::fstat(borrowed_fd(fd), stat.as_mut_ptr().cast()))?;
@@ -2727,12 +2727,12 @@ mod tests {
27272727
#[test]
27282728
fn test_sizes() {
27292729
#[cfg(linux_kernel)]
2730-
assert_eq_size!(c::loff_t, u64);
2730+
static_assertions::assert_eq_size!(c::loff_t, u64);
27312731

27322732
// Assert that `Timestamps` has the expected layout. If we're not fixing
27332733
// y2038, libc's type should match ours. If we are, it's smaller.
27342734
#[cfg(not(fix_y2038))]
2735-
assert_eq_size!([c::timespec; 2], Timestamps);
2735+
static_assertions::assert_eq_size!([c::timespec; 2], Timestamps);
27362736
#[cfg(fix_y2038)]
27372737
assert!(core::mem::size_of::<[c::timespec; 2]>() < core::mem::size_of::<Timestamps>());
27382738
}

src/backend/libc/pipe/types.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ mod tests {
109109
#[cfg(not(any(apple, target_os = "wasi")))]
110110
#[test]
111111
fn test_types() {
112-
assert_eq_size!(PipeFlags, c::c_int);
112+
static_assertions::assert_eq_size!(PipeFlags, c::c_int);
113113

114114
#[cfg(linux_kernel)]
115-
assert_eq_size!(SpliceFlags, c::c_int);
115+
static_assertions::assert_eq_size!(SpliceFlags, c::c_int);
116116
}
117117
}

0 commit comments

Comments
 (0)