Skip to content

Commit ec772b7

Browse files
committed
fix compilation with new new nightly VaList
In 2025-12-05, a Rust pull request at rust-lang/rust#141980 reworked the `VaList` implementation to be abi-compatible with C. This broke: * the `printf-compat` implementation, which is fixed in version 0.3 * some `fcntl` functions, because they called `as_va_list`, and that function no longer exists Here, we fix both of those problems and update the compiler version in `rust-toolchain.toml` to be the oldest compiler that will already have this new implementation.
1 parent a2f804a commit ec772b7

3 files changed

Lines changed: 5 additions & 7 deletions

File tree

c-scape/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ rand = { version = "0.9.0", default-features = false }
3434
rustix-dlmalloc = { version = "0.2.1", optional = true }
3535
rustix-openpty = "0.2.0"
3636
bitflags = { version = "2.4.1", default-features = false }
37-
printf-compat = { version = "0.2.1", default-features = false }
37+
printf-compat = { version = "0.3.0", default-features = false }
3838
num-complex = { version = "0.4.4", default-features = false, features = ["libm"] }
3939
posix-regex = { version = "0.1.1", features = ["no_std"] }
4040

c-scape/src/fs/fcntl.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,16 @@ use libc::c_int;
99
use crate::convert_res;
1010

1111
#[no_mangle]
12-
unsafe extern "C" fn fcntl(fd: c_int, cmd: c_int, mut args: ...) -> c_int {
13-
let args = args.as_va_list();
12+
unsafe extern "C" fn fcntl(fd: c_int, cmd: c_int, args: ...) -> c_int {
1413
_fcntl::<libc::flock>(fd, cmd, args)
1514
}
1615

1716
#[no_mangle]
18-
unsafe extern "C" fn fcntl64(fd: c_int, cmd: c_int, mut args: ...) -> c_int {
19-
let args = args.as_va_list();
17+
unsafe extern "C" fn fcntl64(fd: c_int, cmd: c_int, args: ...) -> c_int {
2018
_fcntl::<libc::flock64>(fd, cmd, args)
2119
}
2220

23-
unsafe fn _fcntl<FlockTy: Flock>(fd: c_int, cmd: c_int, mut args: VaList<'_, '_>) -> c_int {
21+
unsafe fn _fcntl<FlockTy: Flock>(fd: c_int, cmd: c_int, mut args: VaList<'_>) -> c_int {
2422
match cmd {
2523
libc::F_GETFL => {
2624
libc!(libc::fcntl(fd, libc::F_GETFL));

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "nightly-2025-04-28"
2+
channel = "nightly-2025-12-07"
33
components = ["rustc", "cargo", "rust-std", "rust-src", "rustfmt"]

0 commit comments

Comments
 (0)