<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/compiler/rustc_abi/src, branch try-perf</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=try-perf</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=try-perf'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2025-09-29T05:44:55+00:00</updated>
<entry>
<title>Rollup merge of #147134 - workingjubilee:remove-explicit-abialign-deref, r=Zalathar</title>
<updated>2025-09-29T05:44:55+00:00</updated>
<author>
<name>Stuart Cook</name>
<email>Zalathar@users.noreply.github.com</email>
</author>
<published>2025-09-29T05:44:55+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=cd6f32a4eb6b53e7df0882bc396c1c36cf4736ca'/>
<id>urn:sha1:cd6f32a4eb6b53e7df0882bc396c1c36cf4736ca</id>
<content type='text'>
remove explicit deref of AbiAlign for most methods

Much of the compiler calls functions on Align projected from AbiAlign. AbiAlign impls Deref to its inner Align, so we can simplify these away. Also, it will minimize disruption when AbiAlign is removed.

For now, preserve usages that might resolve to PartialOrd or PartialEq, as those have odd inference.
</content>
</entry>
<entry>
<title>remove explicit deref of AbiAlign for most methods</title>
<updated>2025-09-28T22:02:14+00:00</updated>
<author>
<name>Jubilee Young</name>
<email>workingjubilee@gmail.com</email>
</author>
<published>2025-09-28T21:40:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=0c9d0dfe046f0674f0507df564504ac3bac862d9'/>
<id>urn:sha1:0c9d0dfe046f0674f0507df564504ac3bac862d9</id>
<content type='text'>
Much of the compiler calls functions on Align projected from AbiAlign.
AbiAlign impls Deref to its inner Align, so we can simplify these away.
Also, it will minimize disruption when AbiAlign is removed.

For now, preserve usages that might resolve to PartialOrd or PartialEq,
as those have odd inference.
</content>
</entry>
<entry>
<title>compiler: remove AbiAlign inside TargetDataLayout</title>
<updated>2025-09-28T05:13:53+00:00</updated>
<author>
<name>Jubilee Young</name>
<email>workingjubilee@gmail.com</email>
</author>
<published>2025-09-28T03:00:54+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=b3f3e36c72952736be5b9e0360ee5b86148f2c29'/>
<id>urn:sha1:b3f3e36c72952736be5b9e0360ee5b86148f2c29</id>
<content type='text'>
This maintains AbiAlign usage in public API and most of the compiler,
but direct access of these fields is now in terms of Align only.
</content>
</entry>
<entry>
<title>Rollup merge of #144066 - RalfJung:extern-c-variadics, r=workingjubilee</title>
<updated>2025-09-02T15:08:52+00:00</updated>
<author>
<name>Guillaume Gomez</name>
<email>guillaume1.gomez@gmail.com</email>
</author>
<published>2025-09-02T15:08:52+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=ae0e7b97e0c3fa13def0bc60e70d1907c501662e'/>
<id>urn:sha1:ae0e7b97e0c3fa13def0bc60e70d1907c501662e</id>
<content type='text'>
stabilize c-style varargs for sysv64, win64, efiapi, aapcs

This has been split up so the PR now only contains the extended_varargs_abi_support stabilization; "system" has been moved to https://github.com/rust-lang/rust/pull/145954.

**Previous (combined) PR description:**

This stabilizes extern block declarations of variadic functions with the system, sysv64, win64, efiapi, aapcs ABIs. This corresponds to the extended_varargs_abi_support and extern_system_varargs feature gates.

The feature gates were split up since it seemed like there might be further discussion needed for what exactly "system" ABI variadic functions should do, but a [consensus](https://github.com/rust-lang/rust/issues/136946#issuecomment-2967847553) has meanwhile been reached: they shall behave like "C" functions. IOW, the ABI of a "system" function is (bold part is new in this PR):
- "stdcall" for win32 targets **for non-variadic functions**
- "C" for everything else

This had been previously stabilized *without FCP* in https://github.com/rust-lang/rust/pull/116161, which got reverted in https://github.com/rust-lang/rust/pull/136897. There was also a "fun" race condition involved with the system ABI being [added](https://github.com/rust-lang/rust/pull/119587) to the list of variadic-supporting ABIs between the creation and merge of rust-lang/rust#116161.

There was a question raised [here](https://github.com/rust-lang/rust/pull/116161#issuecomment-1983829513) whether t-lang even needs to be involved for a change like this. Not sure if that has meanwhile been clarified? The behavior of the "system" ABI (a Rust-specific ABI) definitely feels like t-lang territory to me.

Fixes rust-lang/rust#100189
Cc `@rust-lang/lang`

# Stabilization report

&gt; ## General design

&gt;  ### What is the RFC for this feature and what changes have occurred to the user-facing design since the RFC was finalized?

AFAIK there is no RFC. The tracking issues are
- https://github.com/rust-lang/rust/issues/100189
- https://github.com/rust-lang/rust/issues/136946

&gt;  ### What behavior are we committing to that has been controversial? Summarize the major arguments pro/con.

The only controversial point is whether "system" ABI functions should support variadics.
- Pro: This allows crates like windows-rs to consistently use "system", see e.g. https://github.com/microsoft/windows-rs/issues/3626.
- Cons: `@workingjubilee` had some implementation concerns, but I think those have been [resolved](https://github.com/rust-lang/rust/issues/136946#issuecomment-2967847553). EDIT: turns out Jubilee still has concerns (she mentioned that in a DM); I'll let her express those.

Note that "system" is already a magic ABI we introduced to "do the right thing". This just makes it do the right thing in more cases. In particular, it means that on Windows one can almost always just do
```rust
extern "system" {
  // put all the things here
}
```
and it'll do the right thing, rather than having to split imports into non-varargs and varargs, with the varargs in a separate `extern "C"` block (and risking accidentally putting a non-vararg there).

(I am saying "almost" always because some Windows API functions actually use cdecl, not stdcall, on x86. Those of course need to go in `extern "C"` blocks.)

&gt; ### Are there extensions to this feature that remain unstable? How do we know that we are not accidentally committing to those?

Actually defining variadic functions in Rust remains unstable, under the [c_variadic feature gate](https://github.com/rust-lang/rust/issues/44930).

&gt; ## Has a Call for Testing period been conducted? If so, what feedback was received?
&gt;
&gt; Does any OSS nightly users use this feature? For instance, a useful indication might be "search &lt;grep.app&gt; for `#![feature(FEATURE_NAME)]` and had `N` results".

There was no call for testing.

A search brings up https://github.com/rust-osdev/uefi-rs/blob/main/uefi-raw/src/table/boot.rs using this for "efiapi". This doesn't seem widely used, but it is an "obvious" gap in our support for c-variadics.

&gt; ## Implementation quality

All rustc does here is forward the ABI to LLVM so there's lot a lot to say here...

&gt; ### Summarize the major parts of the implementation and provide links into the code (or to PRs)
&gt;
&gt; An example for async closures: &lt;https://rustc-dev-guide.rust-lang.org/coroutine-closures.html&gt;.

The check for allowed variadic ABIs is [here](https://github.com/rust-lang/rust/blob/9c870d30e2d6434c9e9a004b450c5ccffdf3d844/compiler/rustc_hir_analysis/src/lib.rs#L109-L126).

The special handling of "system" is [here](https://github.com/rust-lang/rust/blob/c24914ec8329b22ec7bcaa6ab534a784b2bd8ab9/compiler/rustc_target/src/spec/abi_map.rs#L82-L85).

&gt; ### Summarize existing test coverage of this feature
&gt;
&gt; Consider what the "edges" of this feature are.  We're particularly interested in seeing tests that assure us about exactly what nearby things we're not stabilizing.
&gt;
&gt; Within each test, include a comment at the top describing the purpose of the test and what set of invariants it intends to demonstrate. This is a great help to those reviewing the tests at stabilization time.
&gt;
&gt; - What does the test coverage landscape for this feature look like?
&gt;   - Tests for compiler errors when you use the feature wrongly or make mistakes?
&gt;   - Tests for the feature itself:
&gt;       - Limits of the feature (so failing compilation)
&gt;       - Exercises of edge cases of the feature
&gt;       - Tests that checks the feature works as expected (where applicable, `//@ run-pass`).
&gt;   - Are there any intentional gaps in test coverage?
&gt;
&gt; Link to test folders or individual tests (ui/codegen/assembly/run-make tests, etc.).

Prior PRs add a codegen test for all ABIs and tests actually calling extern variadic functions for sysv64 and win64:
- https://github.com/rust-lang/rust/pull/144359
- https://github.com/rust-lang/rust/pull/144379

We don't have a way of executing uefi target code in the test suite, so it's unclear how to fully test efiapi. aapcs could probably be done? (But note that we have hardly an such actually-calling-functions tests for ABI things, we almost entirely rely on codegen tests.)

The test ensuring that we do *not* stabilize *defining* c-variadic functions is `tests/ui/feature-gates/feature-gate-c_variadic.rs`.

&gt; ### What outstanding bugs in the issue tracker involve this feature? Are they stabilization-blocking?

None that I am aware of.

&gt; ### What FIXMEs are still in the code for that feature and why is it ok to leave them there?

None that I am aware of.

&gt; ### Summarize contributors to the feature by name for recognition and assuredness that people involved in the feature agree with stabilization

`@Soveu` added sysv64, win64, efiapi, aapcs to the list of ABIs that allow variadics, `@beepster4096` added system.  `@workingjubilee` recently refactored the ABI handling in the compiler, also affecting this feature.

&gt; ### Which tools need to be adjusted to support this feature. Has this work been done?
&gt;
&gt; Consider rustdoc, clippy, rust-analyzer, rustfmt, rustup, docs.rs.

Maybe RA needs to be taught about the new allowed ABIs? No idea how precisely they mirror what exactly rustc accepts and rejects here.

&gt; ## Type system and execution rules

&gt; ### What compilation-time checks are done that are needed to prevent undefined behavior?
&gt;
&gt;  (Be sure to link to tests demonstrating that these tests are being done.)

Nothing new here, this just expands the existing support for calling variadic functions to more ABIs.

&gt; ### Does the feature's implementation need checks to prevent UB or is it sound by default and needs opt in in places to perform the dangerous/unsafe operations? If it is not sound by default, what is the rationale?

Nothing new here, this just expands the existing support for calling variadic functions to more ABIs.

&gt; ### Can users use this feature to introduce undefined behavior, or use this feature to break the abstraction of Rust and expose the underlying assembly-level implementation? (Describe.)

Nothing new here, this just expands the existing support for calling variadic functions to more ABIs.

&gt; ### What updates are needed to the reference/specification? (link to PRs when they exist)

- https://github.com/rust-lang/reference/pull/1936

&gt; ## Common interactions

&gt; ### Does this feature introduce new expressions and can they produce temporaries? What are the lifetimes of those temporaries?

No.

&gt; ### What other unstable features may be exposed by this feature?

None.
</content>
</entry>
<entry>
<title>stabilize extended_varargs_abi_support</title>
<updated>2025-09-02T06:48:12+00:00</updated>
<author>
<name>Ralf Jung</name>
<email>post@ralfj.de</email>
</author>
<published>2025-08-28T10:03:19+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=f6d55aea2c2cc014f8bb105325ef4c21d2c3d185'/>
<id>urn:sha1:f6d55aea2c2cc014f8bb105325ef4c21d2c3d185</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #144443 - WaffleLapkin:integer-target-pointer-width, r=Noratrieb</title>
<updated>2025-08-31T11:40:34+00:00</updated>
<author>
<name>Matthias Krüger</name>
<email>476013+matthiaskrgr@users.noreply.github.com</email>
</author>
<published>2025-08-31T11:40:34+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=0e28b4201ac8f12cfafe5383f442c7b00f8bdcc6'/>
<id>urn:sha1:0e28b4201ac8f12cfafe5383f442c7b00f8bdcc6</id>
<content type='text'>
Make target pointer width in target json an integer

r? Noratrieb
cc `@RalfJung` (https://github.com/rust-lang/rust/pull/142352/files#r2230380120)

try-job: x86_64-rust-for-linux
</content>
</entry>
<entry>
<title>Rollup merge of #145387 - zachs18:remove-tmplayout, r=cjgillot</title>
<updated>2025-08-29T02:54:10+00:00</updated>
<author>
<name>Stuart Cook</name>
<email>Zalathar@users.noreply.github.com</email>
</author>
<published>2025-08-29T02:54:10+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=dd03ce8cba768ca754ffc11659dd86822dfa9ac2'/>
<id>urn:sha1:dd03ce8cba768ca754ffc11659dd86822dfa9ac2</id>
<content type='text'>
Remove TmpLayout in layout_of_enum

09a3846 from &lt;https://github.com/rust-lang/rust/pull/103693&gt; made LayoutData be owned instead of interned in `Variants::Multiple::variants`[^1], so there's no need for `TmpLayout` in layout_of_enum anymore, and we can just store the variants' layouts directly in the prospective `LayoutData`s' `variants` fields.

This should have no effect on semantics or layout.

(written as part of rust-lang/rust#145337 but not related to the layout optimizations in that PR)

[^1]: see line 1154 of `compiler/rustc_target/src/abi/mod.rs` in the linked commit; `Variants::Multiple::variants` effectively changed from `IndexVec&lt;.., Layout&lt;'tcx&gt;&gt;` to `IndexVec&lt;.., LayoutData&gt;`  where the `LayoutData`s are not interned as `Layout`s (`LayoutData` was at the time called `LayoutS`)
</content>
</entry>
<entry>
<title>turn pointer width into an integer in target.json</title>
<updated>2025-08-27T21:44:49+00:00</updated>
<author>
<name>Waffle Lapkin</name>
<email>waffle.lapkin@gmail.com</email>
</author>
<published>2025-07-25T09:28:37+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=1f7efabdc6204b3a1cc9bfe612136f848f643949'/>
<id>urn:sha1:1f7efabdc6204b3a1cc9bfe612136f848f643949</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Move `IntoDiagArg` earlier in the dependency chains</title>
<updated>2025-08-20T22:01:13+00:00</updated>
<author>
<name>Josh Triplett</name>
<email>josh@joshtriplett.org</email>
</author>
<published>2025-08-14T07:28:44+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=b65fab62999e96acd3683826ffd4140091f185f2'/>
<id>urn:sha1:b65fab62999e96acd3683826ffd4140091f185f2</id>
<content type='text'>
`rustc_errors` depends on numerous crates, solely to implement its
`IntoDiagArg` trait on types from those crates. Many crates depend on
`rustc_errors`, and it's on the critical path.

We can't swap things around to make all of those crates depend on
`rustc_errors` instead, because `rustc_errors` would end up in
dependency cycles.

Instead, move `IntoDiagArg` into `rustc_error_messages`, which has far
fewer dependencies, and then have most of these crates depend on
`rustc_error_messages`.

This allows `rustc_errors` to drop dependencies on several crates,
including the large `rustc_target`.

(This doesn't fully reduce dependency chains yet, as `rustc_errors`
still depends on `rustc_hir` which depends on `rustc_target`. That will
get fixed in a subsequent commit.)
</content>
</entry>
<entry>
<title>Remove TmpLayout in layout_of_enum</title>
<updated>2025-08-14T01:26:13+00:00</updated>
<author>
<name>Zachary S</name>
<email>zasample18+github@gmail.com</email>
</author>
<published>2025-08-12T22:42:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=12b57942d646d27e8d0a615ba4b8a0dea6cf3b9f'/>
<id>urn:sha1:12b57942d646d27e8d0a615ba4b8a0dea6cf3b9f</id>
<content type='text'>
</content>
</entry>
</feed>
