Commit Graph

173175 Commits

Author SHA1 Message Date
bors 57f772f25c Auto merge of #155978 - GuillaumeGomez:subtree-update_cg_gcc_2026-04-29, r=antoyo
GCC backend subtree sync

r? ghost
2026-04-30 04:13:56 +00:00
Jonathan Brouwer d550bd5c1b Rollup merge of #155967 - GuillaumeGomez:doc-cfg-externs, r=Urgau
Fix `doc_cfg` feature for extern items

Part of rust-lang/rust#150268.

It only solves the extern items issue, but not the others listed in the issue. I will need to think about how to fix them nicely.

r? @Urgau
2026-04-29 23:51:42 +02:00
Jonathan Brouwer 2fdbc8bd21 Rollup merge of #155958 - marcoieni:ci-remove-edge-chrome-and-more, r=Mark-Simulacrum
ci(free-disk-space): remove more tools and fix warnings

With this PR I remove more space and improve the free-disk-space-linux script.
If you prefer me to split this PR into multiple ones, let me know.

Discussed in [#t-infra > some jobs running out of disk space](https://rust-lang.zulipchat.com/#narrow/channel/242791-t-infra/topic/some.20jobs.20running.20out.20of.20disk.20space/with/591666099)

## Test

I tested this change in https://github.com/marcoieni/actions-test/commit/196ce70df07febc673dd883c15eb861e3beec414. As you can see the workflows run without warnings, which ensures that we can remove all the space possible from the arm runners.

I also tested this change in this repository, by commenting out the mechanism to skip disk cleanup in case there is sufficient available disk space. ( see https://github.com/rust-lang/rust/pull/155958/commits/86529fb29d42eec3d5070b50efe7f11ce669da32 )
If I don't comment out the code, it can happen that the CI skips the code I edited because there's enough disk space in the runners that this CI is running.

Here's the change of that commit:

```
# sufficientSpaceEarlyExit
# checkAlternative
```

## Storage saved

In that temporary commit, I measured how much we are saving. It looks like this PR saves ~2GB:

* Before this PR, from https://github.com/rust-lang/rust/actions/runs/25082499114/job/73490814240: `Total saved: Saved   35GiB`
* In this PR, from https://github.com/rust-lang/rust/actions/runs/25099446145/job/73544774148: `Total saved: Saved   37GiB`
2026-04-29 23:51:38 +02:00
Jonathan Brouwer 1c764aa73a Rollup merge of #155935 - paradoxicalguy:fix-out-dir-remap, r=Urgau,
remap OUT_DIR paths to fix build script path leakage in crate metadata.

### problem:
- build script outputs (`OUT_DIR`) leak absolute paths into crate metadata causing non-determinism across identical builds.
- bootstrap remaps source paths (`self.build.src`) and registry sources but doesn't not remap `self.build.out` used by `OUT_DIR`

### fix:
- adding `--remap-path-prefix` for `self.build.out` , mapping it to a stable virtual prefix, consistent with existing remappings

### result:
- removes path-based non-determinism from build script outputs
- verified via stage 2 reproducibility testing.

r? @Urgau
2026-04-29 23:51:37 +02:00
Jonathan Brouwer 5a40d360c7 Rollup merge of #155562 - ChayimFriedman2:no-traits, r=nikomatsakis
Add a missing `GenericTypeVisitable`, and avoid having interner traits for `FnSigKind` and `Abi`

r? types
2026-04-29 23:51:30 +02:00
Jonathan Brouwer d0440d3a6a Rollup merge of #155966 - RalfJung:miri, r=RalfJung
miri subtree update

We want to get `-Zmiri-tree-borrows-implicit-writes` into a nightly ASAP, hence the out-of-schedule sync.

Subtree update of `miri` to https://github.com/rust-lang/miri/commit/6961dabc90309b36a981e56e08522a38fc405e22.

Created using https://github.com/rust-lang/josh-sync.

r? @ghost
2026-04-29 23:51:28 +02:00
Guillaume Gomez 04c5d1e297 Update GCC submodule 2026-04-29 23:30:49 +02:00
Chayim Refael Friedman dff9d088ab Avoid having traits in rustc_type_ir for FnSigKind and Abi
Instead, just use the concrete types `FnSigKind` and `rustc_abi::ExternAbi`. This simplifies the code in both rustc and rust-analyzer.
2026-04-29 20:19:26 +03:00
Guillaume Gomez 36138dc0b8 Fix doc_cfg feature for extern items 2026-04-29 18:02:25 +02:00
Dominik Schwaiger 8a513beec6 tree borrows: implicit writes
This PR tries to address https://github.com/rust-lang/unsafe-code-guidelines/issues/584#issue-3440604811. It is part of a bachelor thesis supervised by @JoJoDeveloping and @RalfJung, for more information, see: https://github.com/user-attachments/files/26537277/Project_Description.pdf.
This implements the checking for implicit writes for Tree Borrows. It is disabled by default but can be enabled using the `-Zmiri-tree-borrows-implicit-writes` flag.
When it is enabled, Miri inserts a write for all mutable borrows on function entry. This enables the optimization implemented here: https://github.com/rust-lang/rust/pull/155207
2026-04-29 16:19:15 +02:00
Ralf Jung a87cc71cc9 Merge pull request #4986 from WhySoBad/network-socket-allow-tcp-proto
Allow setting `IPPROTO_TCP` as protocol in `socket` syscall
2026-04-29 11:44:26 +00:00
Ralf Jung e0a3f69177 Merge pull request #4913 from bourumir-wyngs/bw/statx
shims: improve Linux statx
2026-04-29 11:42:18 +00:00
WhySoBad ade1a244ef feat: allow setting IPPROTO_TCP as protocol in socket syscall 2026-04-29 12:51:07 +02:00
MarcoIeni e5493eafc8 ci(free-disk-space): remove more tools and fix warnings 2026-04-29 10:22:11 +02:00
Shoyu Vanilla (Flint) 5d26634476 Rollup merge of #152443 - kjetilkjeka:nvptx_drop_support_old_hw_and_isa, r=ZuseZ4
NVPTX: Drop support for old architectures and old ISAs

This is the implementation of [this MCP](https://github.com/rust-lang/compiler-team/issues/965#issuecomment-3837320262)

I believe it was said that no FCP was needed, but if that is incorrect then the FCP is anyway scheduled to finish in 2 days so it can in any case be merged then.
2026-04-29 10:40:46 +09:00
audrius ce559d2422 shims/unix: improve Linux statx metadata handling
Make FileMetadata track Unix-specific fields as optional data. Advertise
STATX_* bits only for metadata that is actually available.

Add libc-fs coverage for statx on file paths, file
descriptors, and AT_EMPTY_PATH on pipes
2026-04-28 23:22:59 +02:00
Jonathan Brouwer ebbddb36f2 Rollup merge of #155768 - Zalathar:incremental, r=jieyouxu
compiletest: Overhaul the code for running an incremental test revision

The main goals of this overhaul are:
- Introduce a dedicated `IncrRevKind` enum for exhaustive matching.
- Eliminate any dependency on `PassMode` and `FailMode`.
- Use a single code path for all incremental revision kinds.

Separating incremental tests from the existing pass/fail enums should make it easier to overhaul the implementation of pass/fail expectations in UI tests.

---

Later on we might want to reintroduce more shared code paths for the different test modes, but for now the extra isolation makes it easier to clean up the individual modes.

r? jieyouxu
2026-04-28 20:24:35 +02:00
Jonathan Brouwer 57f2b15a53 Rollup merge of #155747 - arjunr2:main, r=davidtwco
Update documentation for `wasm32-wali-linux-musl` after integrating n…

Additional documentation updates, along with rust-lang/rust#155654
2026-04-28 20:24:34 +02:00
Jonathan Brouwer c6912bf401 Rollup merge of #155692 - fneddy:fix_naked-dead-code-elimination, r=folkertdev
disable naked-dead-code-elimination test if no RET mnemonic is available

this test emit x86_64 specific ret asm instruction and should not be compiled on any other arch.
2026-04-28 20:24:33 +02:00
Jonathan Brouwer 8f15da4d30 Rollup merge of #155361 - Darksonn:abi-cfi, r=RalfJung
Document that CFI diverges from Rust wrt. ABI-compatibility rules

The CFI sanitizer is a sanitizer that checks that no ABI-incompatible function calls are made at runtime, but there is currently an unfortunate divergence between the Rust ABI-compatibility rules and what the CFI sanitizer checks. Thus, document that this divergence exists.

There are proposals for how we can align the ABI rules to eliminate this discrepancy, and I would like to follow through with those, but for now I think we can at least document that the discrepancy exists.

For further discussion please see [Re-evaluate ABI compatibility rules in light of CFI](https://github.com/rust-lang/unsafe-code-guidelines/issues/489) and [Can CFI be made compatible with type erasure schemes?](https://github.com/rust-lang/rust/issues/128728) and [`fn_cast!` macro](https://github.com/rust-lang/rust/issues/140803).

cc @rcvalle @samitolvanen @maurer @bjorn3 @RalfJung

Rendered:

<img width="956" height="391" alt="image" src="https://github.com/user-attachments/assets/410d3eaa-9476-4800-9ef8-bbb100a100c5" />
2026-04-28 20:24:32 +02:00
Jonathan Brouwer 1857d2ee9f Rollup merge of #151994 - davidtwco:v0-mangling-on-stable, r=wesleywiser
switch to v0 mangling by default on stable

Following rust-lang/rust#89117, rustc has defaulted to the v0 mangling scheme by default (since Nov 20th 2025). This surfaced two bugs:

- rust-lang/rust#138261 was a small ICE (found via fuzzing) where an implementation-internal namespace was missing for global assembly - this occurs with names instantiated within global assembly (that can happen inside constants)

- rust-lang/rust#134479 only occurs with unstable `generic_const_exprs`

Since there have been three-to-four months for users to find bugs with this mangling scheme on nightly, that the scheme has been waiting many years to be stabilised, and has been used successfully internally at Microsoft, Meta and Google for many years, this patch proposes stabilising the v0 mangling scheme on stable.

This patch does not propose removing the legacy mangling, it will remain usable on nightly as an escape-hatch if there are remaining bugs (though admittedly it would require switching to nightly for those on stable) - it is anticipated that this would be unlikely given current testing undergone by v0. Legacy mangling can be removed in another follow-up.

r? @wesleywiser
2026-04-28 20:24:29 +02:00
abhinav srivastav 26ce8a9d5c Apply suggestion from @bjorn3
Co-authored-by: bjorn3 <17426603+bjorn3@users.noreply.github.com>
2026-04-28 22:35:17 +05:30
paradoxicalguy e743a4db62 bootstrap: remap OUT_DIR paths to fix build script path leakage in artifacts 2026-04-28 16:58:24 +00:00
Alice Ryhl aef93ca43a Document that CFI diverges from Rust wrt. ABI-compatibility rules 2026-04-28 15:16:49 +00:00
Ralf Jung 74109afaf2 Merge pull request #4963 from elichai/elichai/_mm512_permutex2var_epi64
Implement `_mm512_permutex2var_epi64` shim
2026-04-28 14:40:29 +00:00
Elichai Turkel fdb1e26d54 Add _mm512_permutex2var_epi64 shim 2026-04-28 17:14:35 +03:00
Jacob Pratt f4d64bdd15 Rollup merge of #155854 - cammeresi:20260426-receiver-diag, r=mejrs
Rename the diagnostic item for `std::sync::mpsc::Receiver`

`MpscReceiver` aligns with `MpscSender`.  The original name appears to not actually have been in use, for better or worse.

r? mejrs
2026-04-28 05:37:27 -04:00
Eddy (Eduard) Stefes 2a8e588c90 Add --print=backend-has-mnemonic and needs-asm-mnemonic directive
Add infrastructure to query LLVM backend for specific assembly mnemonics
and use it in compiletest to conditionally run tests based on instruction
availability.

This fixes test failures with naked-dead-code-elimination which requires
the `RET` mnemonic.

Co-authored-by: Folkert de Vries <flokkievids@gmail.com>
2026-04-28 10:21:15 +02:00
dianqk cf8a60c20d Update LLVM to 22.1.4 2026-04-28 15:17:56 +08:00
Kjetil Kjeka a2d23cec5f NVPTX: Drop support for old hw and old ISAs 2026-04-28 08:48:22 +02:00
Sidney Cammeresi 04874be3a2 Adjust diagnostic items for mpmc/mpsc Receiver and Sender
`MpscReceiver` aligns with `MpscSender`.  The original name appears to
not actually have been in use, for better or worse.

Along the way, sprinkle the attribute onto `mpmc::Receiver` and
`mpmc::Sender` too.
2026-04-27 17:16:09 -07:00
Jonathan Brouwer 5a87e1cadf Rollup merge of #155876 - ojeda:rfl, r=lqd
CI: rfl: move job forward to Linux v7.1-rc1

Linux v7.1 will have our new MSRVs: Rust 1.85.0 and `bindgen` 0.71.1.

r? @lqd @Kobzol
try-job: x86_64-rust-for-linux
@rustbot label A-rust-for-linux
@bors try
2026-04-27 19:54:50 +02:00
Jonathan Brouwer e8ad7f25e4 Rollup merge of #155702 - mejrs:itemkind_trait-fields, r=petrochenkov
Change `ItemKind::Trait` to a field variant.

This changes `ItemKind::Trait` from an octuple(!!) to an enum variant with fields. Their names were chosen to match up with existing usage and minimize renaming.

I'm leaning towards renaming `ident` to `name` as well; let me know if that's desired.
2026-04-27 19:54:46 +02:00
Ralf Jung 8f298e2b07 minor adjustments 2026-04-27 15:27:09 +02:00
Enrico Bolzonello ef8e0c92c8 add stat and lstat shims for Linux and all other Unixes 2026-04-27 15:25:28 +02:00
Jonathan Brouwer 30f08d3ab2 Rollup merge of #155864 - JonathanBrouwer:doc-attr-span, r=GuillaumeGomez
Fix panic for doc attributes on where predicates

Fixes https://github.com/rust-lang/rust/issues/155804

r? @GuillaumeGomez
2026-04-27 14:44:19 +02:00
Miguel Ojeda 57008e9e3b CI: rfl: move job forward to Linux v7.1-rc1
Linux v7.1 will have our new MSRVs: Rust 1.85.0 and `bindgen` 0.71.1.

Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2026-04-27 14:21:07 +02:00
Jacob Pratt d03a7c9bf6 Rollup merge of #155833 - ojeda:rfl, r=lqd
CI: rfl: move job forward to Linux v7.0

This version contains both of the workarounds we had, thus remove them as well.

r? @lqd @Kobzol
try-job: x86_64-rust-for-linux
@rustbot label A-rust-for-linux
@bors try
2026-04-27 03:48:44 -04:00
Jonathan Brouwer cafe02e1e3 Add first_span to doc attribute 2026-04-27 09:47:23 +02:00
Jacob Pratt f8e3af446e Rollup merge of #149624 - Flakebi:fix-lto, r=bjorn3
Fix requires_lto targets needing lto set in cargo

Targets that set `requires_lto = true` were not actually using lto when compiling with cargo by default. They needed an extra `lto = true` in `Cargo.toml` to work.

Fix this by letting lto take precedence over the `embed_bitcode` flag when lto is required by a target.

If both these flags would be supplied by the user, an error is generated. However, this did not happen when lto was requested by the target instead of the user.

Fixes rust-lang/rust#148514
Tracking issue: rust-lang/rust#135024
2026-04-26 21:56:39 -04:00
Jonathan Brouwer 37b53a9461 Rollup merge of #155789 - JonathanBrouwer:attribute-ext, r=mejrs
Cleanups to `AttributeExt`

r? @mejrs

- Makes some functions take `ast::Attribute` instead of `impl AttributeExt`
- Remove `deprecation_note` from `AttributeExt`, since the two implementations are basically seperate
2026-04-26 19:06:29 +02:00
Jonathan Brouwer a722bc89a0 Rollup merge of #155823 - RalfJung:miri, r=RalfJung
miri subtree update

Subtree update of `miri` to https://github.com/rust-lang/miri/commit/f3f6dca488fbfe482af4e5b6976677b6a68bda85.

Created using https://github.com/rust-lang/josh-sync.

r? @ghost
2026-04-26 19:06:26 +02:00
Miguel Ojeda 1e6ba4f385 CI: rfl: move job forward to Linux v7.0
This version contains both of the workarounds we had, thus remove them
as well.

Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2026-04-26 17:49:24 +02:00
Ralf Jung 9ae47c9b53 Merge pull request #4812 from enthropy7/master
Support fstat on non-file-backed FDs
2026-04-26 11:23:07 +00:00
Ralf Jung c91a363db1 merge fstat and metadata functions 2026-04-26 12:59:02 +02:00
Miikka Salminen 33c1e869d7 Expand the initialism UCRT in rustc book
This commit expands the initialism UCRT on first use in the rusct book
chapter on the *-windows-gnullvm platform support, making the chapter
easier to understand. Microsoft, the originator of this technology in
Windows, expands it to Universal C Runtime[1]. The same expansion is
added to the chapter.

[1] https://learn.microsoft.com/en-us/cpp/porting/upgrade-your-code-to-the-universal-crt
2026-04-26 09:05:37 +03:00
Jonathan Brouwer dde4886801 Rollup merge of #146181 - Flakebi:dynamic-shared-memory, r=ZuseZ4,Sa4dus,workingjubilee,RalfJung,nikic,kjetilkjeka,kulst
Add intrinsic for launch-sized workgroup memory on GPUs

Workgroup memory is a memory region that is shared between all
threads in a workgroup on GPUs. Workgroup memory can be allocated
statically or after compilation, when launching a gpu-kernel.
The intrinsic added here returns the pointer to the memory that is
allocated at launch-time.

# Interface

With this change, workgroup memory can be accessed in Rust by
calling the new `gpu_launch_sized_workgroup_mem<T>() -> *mut T`
intrinsic.

It returns the pointer to workgroup memory guaranteeing that it is
aligned to at least the alignment of `T`.
The pointer is dereferencable for the size specified when launching the
current gpu-kernel (which may be the size of `T` but can also be larger
or smaller or zero).

All calls to this intrinsic return a pointer to the same address.

See the intrinsic documentation for more details.

## Alternative Interfaces

It was also considered to expose dynamic workgroup memory as extern
static variables in Rust, like they are represented in LLVM IR.
However, due to the pointer not being guaranteed to be dereferencable
(that depends on the allocated size at runtime), such a global must be
zero-sized, which makes global variables a bad fit.

# Implementation Details

Workgroup memory in amdgpu and nvptx lives in address space 3.
Workgroup memory from a launch is implemented by creating an
external global variable in address space 3. The global is declared with
size 0, as the actual size is only known at runtime. It is defined
behavior in LLVM to access an external global outside the defined size.

There is no similar way to get the allocated size of launch-sized
workgroup memory on amdgpu an nvptx, so users have to pass this
out-of-band or rely on target specific ways for now.

Tracking issue: rust-lang/rust#135516
2026-04-25 23:07:48 +02:00
Jonathan Brouwer e3b0e9db08 Remove deprecation_note from AttributeExt 2026-04-25 21:26:00 +02:00
Zalathar da0fe8db67 Overhaul the code for running an incremental test revision
The main goals of this overhaul are:
- Introduce a dedicated `IncrRevKind` enum for exhaustive matching.
- Eliminate any dependency on `PassMode` and `FailMode`.
- Use a single code path for all incremental revision kinds.

Separating incremental tests from the existing pass/fail enums should make it
easier to overhaul the implementation of pass/fail expectations in UI tests.
2026-04-25 17:28:27 +10:00
bors 7e0430fafc Auto merge of #155766 - jhpratt:rollup-EcXAaqS, r=jhpratt
Rollup of 7 pull requests

Successful merges:

 - rust-lang/rust#155643 (Improve suggestion for $-prefixed fragment specifiers)
 - rust-lang/rust#154197 (Avoid redundant clone suggestions in borrowck diagnostics)
 - rust-lang/rust#154372 (Exposing Float Masks)
 - rust-lang/rust#155680 (Handle index projections in call destinations in DSE)
 - rust-lang/rust#155732 (bootstrap: Don't clone submodules unconditionally in dry-run)
 - rust-lang/rust#155737 (Account for `GetSyntheticValue` failures)
 - rust-lang/rust#155738 (Pass fields to `is_tuple_fields` instead of `SBValue` object)
2026-04-25 06:41:56 +00:00