transpile: fix variadics in edition 2024#1657
Merged
Conversation
ahomescu
approved these changes
Mar 14, 2026
15 tasks
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.
5bb5fea to
6ede792
Compare
…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()`.
6ede792 to
893f29e
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
VaListImplwas removed by rust-lang/rust#141980 innightly-2025-12-07, so for thenightly-2026-03-03we're using for--edition 2024, we need to switch fromVaListImpltoVaListand from.as_va_list()to.clone(). However, this isn't a change strictly tied to the edition change, but justrustcchanging over time, so we may want to introduce a--nightly-toolchainor similar argument in addition to--editionto control this, in casenightly-2025-12-06with--edition 2024is 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)]stabilizedcore::intrinsics::pref_align_ofremovedcore::intrinsicschanged[profile.release] strip = "debuginfo"made the default