Skip to content

transpile: fix variadics in edition 2024#1657

Merged
kkysen merged 6 commits intomasterfrom
kkysen/transpile-edition-2024-varargs
Mar 14, 2026
Merged

transpile: fix variadics in edition 2024#1657
kkysen merged 6 commits intomasterfrom
kkysen/transpile-edition-2024-varargs

Conversation

@kkysen
Copy link
Contributor

@kkysen kkysen commented Mar 13, 2026

VaListImpl was removed by rust-lang/rust#141980 in nightly-2025-12-07, so for the nightly-2026-03-03 we're using for --edition 2024, we need to switch from VaListImpl to VaList and from .as_va_list() to .clone(). However, this isn't a change strictly tied to the edition change, but just rustc changing over time, so we may want to introduce a --nightly-toolchain or similar argument in addition to --edition to control this, in case nightly-2025-12-06 with --edition 2024 is desired, for example. This is also true of a bunch of other changes, like

  • #![feature(stdsimd)] split/stabilized
  • #![feature(raw_ref_op)] stabilized
  • #![feature(label_break_value)] stabilized
  • #![feature(asm)] stabilized
  • core::intrinsics::pref_align_of removed
  • atomic core::intrinsics changed
  • [profile.release] strip = "debuginfo" made the default

kkysen added a commit that referenced this pull request Mar 14, 2026
This fixes the following differences with edition 2024:
* [x] `#[unsafe(no_mangle)]`
* [x] `#[unsafe(export_name = "")]`
* [x] `#[unsafe(link_section = "")]`
* [x] `unsafe extern "C" {`
* [ ] `unsafe fn`s and `safe fn`s in `unsafe extern "C" {}`s
  * not required, default to `unsafe fn`s
* [x] `#![feature(stdsimd)]` removed and split up
* [x] stabilized `#![feature(raw_ref_op)]` removed
* [x] stabilized `#![feature(label_break_value)]` removed
* [x] stabilized `#![feature(asm)]` removed
* [x] `[profile.release] strip = "debuginfo"` being the default
* [ ] (#1658) updated atomic intrinsics (`atomics.c`)
* [ ] `gen` reserved keyword (`keywords.c`)
* [ ] (#1657) updated `VaListImpl` (`varargs.c`)
* [ ] `#[warn(unsafe_op_in_unsafe_fn)]` enabled by default
* In `tests/unit/`, we add `#![allow(unsafe_op_in_unsafe_fn)]` for now.
* Proper fix of an outer `unsafe` block in `unsafe fn`s (or
finer-grained ones) we can do later.
* [ ] (#1656) `pref_align_of` removed
(rust-lang/rust#141803)
  * used to translate `__alignof`
  * no alternative, so may have to drop support

This also runs the correct `rustfmt`, as we were previously just picking
up whichever one `rustup` resolved.

* Fixes #1298.

This updates all of the transpiler snapshot tests and `tests/unit/`
tests that work on edition 2024 with the above fixes. The remaining
fixes I'll fix in separate PRs, as they might be trickier.
@kkysen kkysen force-pushed the kkysen/transpile-edition-2024-varargs branch from 5bb5fea to 6ede792 Compare March 14, 2026 06:06
@kkysen kkysen changed the base branch from kkysen/transpile-edition-2024-remove-pref_align_of to master March 14, 2026 06:07
kkysen added 6 commits March 13, 2026 23:19
…o simplify creation

There doesn't seem to be a point in calling `TypeConvert::new()` and then setting fields,
vs. just setting them in `fn new` to begin with.
We already don't want to `impl Default`.
In edition 2024 (more specifically, in rust-lang/rust#141980),
`VaListImpl` was removed, folding the functionality all into a single `VaList`
and moving the pass-by-value distinction into the compiler.
Thus, we replace `VaListImpl` with `VaList`
and `.as_va_list()` with `.clone()`.
@kkysen kkysen force-pushed the kkysen/transpile-edition-2024-varargs branch from 6ede792 to 893f29e Compare March 14, 2026 06:58
@kkysen kkysen merged commit 9dd6f33 into master Mar 14, 2026
11 checks passed
@kkysen kkysen deleted the kkysen/transpile-edition-2024-varargs branch March 14, 2026 07:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants