Commit Graph

336743 Commits

Author SHA1 Message Date
Zalathar
fac494eced Remove unused field Config::configure_args 2026-08-17 17:32:00 +10:00
Zalathar
f874124cc2 Make the Tool enum non-pub 2026-08-17 17:32:00 +10:00
bors
eaa160c49d Auto merge of #161082 - nnethercote:overhaul-CoroutineMarker, r=mejrs
Overhaul `CoroutineKind`

Its structure is a bit weird. Details in individual commits.

r? @mejrs
2026-08-17 02:41:22 +00:00
Nicholas Nethercote
613e826eaa Overhaul CoroutineKind
It is an enum with three variant, and all the variants have identical
fields, which is silly. This commit does the following.

- Renames it as `CoroutineMarker`, because the `Kind` suffix is used for
  enums. (The existing doc comment already uses the word "marker".)

- Renames the existing `GenBlockKind` as `CoroutineKind`, uses it
  within `CoroutineMarker`, and adds `CoroutineKind::is_gen`.

This removes the need for the `span`, `closure_id` and `return_id`
methods; direct field access now suffices.
2026-08-17 12:29:59 +10:00
bors
2c39ff4994 Auto merge of #161196 - JonathanBrouwer:rollup-JHCyFaw, r=JonathanBrouwer
Rollup of 17 pull requests

Successful merges:

 - rust-lang/rust#161017 (Library: enforce clippy deref lints in CI)
 - rust-lang/rust#160416 (std: fix unix socket address truncation without a trailing NUL)
 - rust-lang/rust#161006 ([CI] Build newer `binutils` before building `gcc`)
 - rust-lang/rust#161141 (Add documentation for BPF targets)
 - rust-lang/rust#161157 (bootstrap: Move several items out of the crate root)
 - rust-lang/rust#161185 (std: guard against unwinds in queue-based `Once`)
 - rust-lang/rust#161186 (miri subtree update)
 - rust-lang/rust#159855 (std: retry waitid on EINTR in the pidfd wait path)
 - rust-lang/rust#160478 (diagnostics: Suggest fn binding type for unstable closure for<> binders)
 - rust-lang/rust#161053 (Add regression test for borrow of array drop type in const)
 - rust-lang/rust#161073 (Add regression test for path printing with infinitely many visible names)
 - rust-lang/rust#161099 (Add regression test for unstable def_ident_span fingerprint with incremental recompilation)
 - rust-lang/rust#161103 (cleanup: rip out unnecessary `iter().last()` and `iter().next()`)
 - rust-lang/rust#161136 (Add BPF test for Rust ABI stack arguments)
 - rust-lang/rust#161146 (Switch to c8a EC2 runner for auto merges)
 - rust-lang/rust#161148 ([rustdoc] Put back one removed flaky GUI test (which hopefully isn't flaky anymore))
 - rust-lang/rust#161181 (Add back flaky gui rustdoc test `tests/rustdoc-gui/headers-color.goml`)
2026-08-16 21:56:28 +00:00
Jonathan Brouwer
9692358a86 Rollup merge of #161181 - GuillaumeGomez:rustdoc-flaky-gui-back, r=Urgau
Add back flaky gui rustdoc test `tests/rustdoc-gui/headers-color.goml`

Part of https://github.com/rust-lang/rust/issues/152197.

This PR adds back `tests/rustdoc-gui/headers-color.goml` with a little tweak: instead of using `go-to` command to change the focused element, we click on the anchors.

r? @Urgau
2026-08-16 22:46:28 +02:00
Jonathan Brouwer
d205f090bc Rollup merge of #161148 - GuillaumeGomez:put-back-gui-test, r=Urgau
[rustdoc] Put back one removed flaky GUI test (which hopefully isn't flaky anymore)

Part of https://github.com/rust-lang/rust/issues/152197

You can see the original code of this test in https://github.com/rust-lang/rust/pull/152194 (where it was removed).

The `browser-ui-test` update comes from https://github.com/GuillaumeGomez/browser-UI-test/pull/759. We can now use the `click` command to click on an `option` inside a `select` (surprisingly enough, it needs to be special-cased in puppeteer...).

That update allowed me to replace all the `press-key` with one `click`. Starting from this change, I couldn't reproduce the failure, so hopefully it's gone.

cc @notriddle @JonathanBrouwer

r? @Urgau
2026-08-16 22:46:28 +02:00
Jonathan Brouwer
2bcfb1e9b3 Rollup merge of #161146 - Mark-Simulacrum:ec2-auto, r=Kobzol
Switch to c8a EC2 runner for auto merges

I *think* this is the only line that needs changing to switch? I expect we'll want to clean up the codebuild stuff, but I think it makes sense to leave it in place until this has merged successfully and run for a few weeks.

r? Kobzol
2026-08-16 22:46:27 +02:00
Jonathan Brouwer
7b9ed051c3 Rollup merge of #161136 - amirHdev:investigate-bpf-123150, r=folkertdev
Add BPF test for Rust ABI stack arguments
2026-08-16 22:46:26 +02:00
Jonathan Brouwer
eea64727ef Rollup merge of #161103 - makai410:cleanup-iter-last, r=mu001999
cleanup: rip out unnecessary `iter().last()` and `iter().next()`

Continuation of https://github.com/rust-lang/rust/pull/145402
2026-08-16 22:46:25 +02:00
Jonathan Brouwer
21fd8be4a9 Rollup merge of #161099 - zakrad:regr-test-95945, r=folkertdev
Add regression test for unstable def_ident_span fingerprint with incremental recompilation

Closes rust-lang/rust#95945
2026-08-16 22:46:24 +02:00
Jonathan Brouwer
3fa91853b6 Rollup merge of #161073 - zakrad:regr-test-57500, r=mejrs
Add regression test for path printing with infinitely many visible names

Closes rust-lang/rust#57500
2026-08-16 22:46:23 +02:00
Jonathan Brouwer
c7b50e4dcc Rollup merge of #161053 - zakrad:regr-test-86672, r=mejrs
Add regression test for borrow of array drop type in const

Closes rust-lang/rust#86672
2026-08-16 22:46:22 +02:00
Jonathan Brouwer
75b25343be Rollup merge of #160478 - Dnreikronos:diagnostics/closure_lifetime_binder_sugg, r=mejrs
diagnostics: Suggest fn binding type for unstable closure for<> binders

Fixes rust-lang/rust#160431

`for<'a> |x: &'a T| -> U { ... }` currently just says "consider removing for<...>", which idk is kinda useless when someone landed there while fighting HRTB errors. This rewrites the obvious case to `let cl: for<'a> fn(...) = |x| { ... }` instead.

Visitor emits the gate so we have AST context for the rewrite, and we still keep a pre-expansion fallback for `#[cfg(false)]` etc. MachineApplicable only when we're pretty sure: by-value bindings, lifetime-only unbounded binders, no `_` in the sig, no macro expansion. Capture checking is a conservative single-segment free-path heuristic since this runs pre-resolution/pre-typeck; when that looks uncertain we fall back to MaybeIncorrect (or just "consider removing"). imo that's the right tradeoff here: better a maybe-wrong help than rustfix auto-applying into E0308. fyi free-fn / `None` / `Some` cases also hit MaybeIncorrect for the same reason.

ltm if the heuristic feels too conservative and y'all want it tightened later.
2026-08-16 22:46:22 +02:00
Jonathan Brouwer
5b52f7ddb3 Rollup merge of #159855 - valentynkit:pidfd-wait-eintr, r=Mark-Simulacrum
std: retry waitid on EINTR in the pidfd wait path

The pidfd-backed `Child::wait()` and `try_wait()` share a `waitid` helper that calls `waitid` through plain `cvt`, so an `EINTR` reaches the caller as `ErrorKind::Interrupted`. The legacy `waitpid` path that the pidfd path stands in for retries instead: `wait()` there uses `cvt_r`. So a child spawned with a pidfd can see `Interrupted` from `wait()` where the same call without one wouldn't.

Both callers go through the one helper, so this wraps the `waitid` call in `cvt_r` to match the legacy `wait()`:

```rust
let r = cvt_r(|| unsafe {
    libc::waitid(libc::P_PIDFD, self.0.as_raw_fd() as u32, &mut siginfo, options)
});
```

For the blocking `wait()` that's the fix. `try_wait()` passes `WNOHANG`, and `waitid` only returns `EINTR` when it isn't set, from
[`wait(2)`](https://www.man7.org/linux/man-pages/man2/wait.2.html#ERRORS):
> EINTR  WNOHANG was not set and an unblocked signal or a SIGCHLD was caught; see signal(7).

I didn't add a test, since landing an `EINTR` in the wait window needs a signal to arrive at the right moment and isn't practical to reproduce.

r? libs
2026-08-16 22:46:21 +02:00
Jonathan Brouwer
7145327c9a Rollup merge of #161186 - RalfJung:miri, r=RalfJung
miri subtree update

Subtree update of `miri` to ac0adc4fb8.

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

r? @ghost
2026-08-16 22:46:20 +02:00
Jonathan Brouwer
338779cd0e Rollup merge of #161185 - joboet:unwind_queue_once, r=clarfonthey
std: guard against unwinds in queue-based `Once`

While the public `thread::park` guards against unwinds, the inner `Thread::park` method does not. In the unlikely but plausible scenario that it did, this would lead to undefined behaviour in the queue-based `Once`; a thread's waiter node must be removed from the list before it can be freed. To fix this, promote unwinds to aborts, just like the queue-based `RwLock` [does](874e6f2a53/library/std/src/sys/sync/rwlock/queue.rs (L428-L429)).
2026-08-16 22:46:19 +02:00
Jonathan Brouwer
2ac08f3364 Rollup merge of #161157 - Zalathar:bootstrap-root, r=Kobzol
bootstrap: Move several items out of the crate root

Prior to bulk-moving everything out of the crate root, this PR moves several individual items to more suitable modules.

There should be no change to bootstrap behaviour.
2026-08-16 22:46:18 +02:00
Jonathan Brouwer
754159a986 Rollup merge of #161141 - vadorovsky:vad/docs-platform-bpf, r=nagisa,jieyouxu
Add documentation for BPF targets

BPF targets, despite being Tier 3, were lacking documentation. Add it, describing how the targets work.

Nominate @nagisa and myself as maintainers.
2026-08-16 22:46:17 +02:00
Jonathan Brouwer
5d4e11e1b5 Rollup merge of #161006 - GuillaumeGomez:gcc-binutils, r=Kobzol
[CI] Build newer `binutils` before building `gcc`

Hopefully will unblock the GCC sync. This PR builds a newer `binutils`, unlocking all blocked `gcc` features that we need.

Needs https://github.com/rust-lang/ci-mirrors/pull/55 to be merged first.

r? @Kobzol
2026-08-16 22:46:16 +02:00
Jonathan Brouwer
71b938ce4e Rollup merge of #160416 - devnexen:gh118925, r=Mark-Simulacrum
std: fix unix socket address truncation without a trailing NUL

getsockname(2) and friends do not count the trailing NUL in the length they report on freebsd, netbsd and qnx, and a caller may bind(2) without one anywhere, so shortening the path by one byte dropped its last character. scan for the NUL within the reported length instead, which is the rule unix(7) gives and subsumes the qnx case the old cfg handled.

Fixes rust-lang/rust#118925
2026-08-16 22:46:15 +02:00
Jonathan Brouwer
1deb5294cc Rollup merge of #161017 - ChrisDenton:clippy2, r=nia-e
Library: enforce clippy deref lints in CI

Best reviewed commit by commit.

The output is from `clippy --fix` but I've reviewed the changes and am feeling confident there are no behaviour changes. Still, a second pair of eyes would be useful.
2026-08-16 22:46:14 +02:00
Ralf Jung
2e791273c5 make memcmp test less constrained 2026-08-16 22:19:59 +02:00
bors
34baba5394 Auto merge of #160529 - cuviper:deps, r=Mark-Simulacrum
Upgrade and deduplicate dependencies



- Upgrade from `getrandom v0.4.2` to `v0.4.3` to drop its `wasip2` and
  `wasip3` dependencies and many transitives.
- Upgrade from `gimli v0.33` to `v0.34` as a direct dependency and
  through a `thorin-dwp` upgrade.
- Upgrade from `object v0.37` and `v0.38` to `v0.39` as a direct
  dependency and via `ar_archive_writer` and `thorin-dwp` upgrades.
- Upgrade `libloading` and `wasmparser` to match other dependencies.

This also consolidates from `hashbrown v0.15`, `v0.16`, and `v0.17` to
just `v0.17.1`, which is the same that `std` currently uses.
2026-08-16 18:44:21 +00:00
Joao Roberto
916b10c99b Replace structured for<> rewrite with a generic help
The visitor-based rewrite needed extra gate bookkeeping for
cfg'd-out spans and was too much complexity for feature_gate.
Keep gate_all! and point people at a for<> fn type annotation
instead.
2026-08-16 13:01:48 -03:00
Guillaume Gomez
9162595a5a Add back flaky gui rustdoc test tests/rustdoc-gui/headers-color.goml 2026-08-16 17:46:48 +02:00
Amirhossein Akhlaghpour
59022bf58d Add BPF test for Rust ABI stack arguments
Co-authored-by: Folkert de Vries <flokkievids@gmail.com>
Signed-off-by: Amirhossein Akhlaghpour <m9.akhlaghpoor@gmail.com>
2026-08-16 18:41:18 +03:30
bors
bf063f193b Auto merge of #160916 - Kobzol:bootstrap-llvm-2, r=jieyouxu
Assorted bootstrap LLVM refactors (part 2/N)

Continuation of https://github.com/rust-lang/rust/pull/160645.

This PR removes dependence on implicit LLVM CI paths, and generally tries to make depending on various LLVM things more explicit wherever possible. One nice outcome of that is that we no longer override the LLVM config during config parsing when using `download-ci-llvm` 🎉 We also no longer dynamically download LLVM from CI when someone asks what is the LLVM linkage mode, lol (well, we still need to do it in a few places, but now at least it is explicit).

I tried to ensure that `x check compiler` does not build or even checkout the LLVM submodule. That being said, there might be some cases where calling `get_llvm_build_status` might now checkout the LLVM submodule (but it shouldn't happen for `x test mir-opt --bless`, which was fixed in https://github.com/rust-lang/rust/pull/130918 - that PR introduced a boolean flag, but it was difficult to understand where it should be set to `false`/`true`).

The next thing after this is to try getting rid of the `llvm_out` function, though that will be probably quite painful. And also explicitly depending on the output of `LlvmFromCi`, rather than reading `llvm_ci_mode`.

I printed some step traces using commands like this:
```
BOOTSTRAP_TRACING=STEP=trace BOOTSTRAP_TRACING_SKIP_TIME=1 ./x build compiler 2> post-cg_default-build-compiler.txt
```
with this PR and on `main`.

The `BOOTSTRAP_TRACING_SKIP_TIME` thing was added in the first commit to make it easier to compare step traces. But later I realized that we should also normalize source code locations of the steps, otherwise if you modify something in a given file with the step, its location will change and it will perturb the diff. Anyway, I can drop the first commit if you want.

Best reviewed commit-by-commit (in fact I don't think it can be really reviewed in another way, lol).

r? jieyouxu
2026-08-16 14:34:01 +00:00
bors
874e6f2a53 Auto merge of #160889 - nnethercote:simplify-MaybeBorrowedLocals, r=cjgillot
Simplify `MaybeBorrowedLocals`

It is implemented as a `Visitor`, but it only uses `visit_statement`, `visit_terminator`, and `visit_rvalue`. Visiting statements and terminators is trivial without a `Visitor`, and visiting rvalues is almost as easy because they can only appear at the top-level of a `StatementKind::Assign`. So a `Visitor` is overkill, because we don't have to worry about nesting (like we would with expressions, for example).

So this commit restructures `MaybeBorrowedLocals` to not use a `Visitor`, which makes the analysis shorter and simpler. `gen_statement` and `gen_terminator` are added to do most of the work, and are called from several places. They are similar to the equivalent `visit_*` methods but `gen_statement` doesn't do any kills. So how are kills for statements handled?

- In `Self::apply_primary_statement_effect` we now explicitly kill (on a `StorageDead` stmt) after calling `gen_statement`.

- `borrowed_locals` doesn't do kills; in fact it currently has its own custom `GenKill` to avoid killing anything. So `gen_{statement,terminator}` are enough for it.

- `MaybeRequiresStorage::apply_early_statement_effect` already has an explicit kill. (I.e. it killed each local a second time, after calling the transfer function.)

r? @cjgillot
2026-08-16 10:34:57 +00:00
Guillaume Gomez
d7bd2df6bb Add code comment explaining why we need this binutils version 2026-08-16 12:20:03 +02:00
Zalathar
d5a84642a4 Move/rename/adjust prepare_behaviour_dump_dir
The destination is `crate::core::builder::cargo`, the new name is
`prepare_shims_dump_dir`, and the adjustment is to take `&Builder<'_>` instead
of `&Build`.
2026-08-16 20:12:40 +10:00
Zalathar
af768f6825 Move envify into crate::utils::helpers and add a test 2026-08-16 20:12:40 +10:00
Zalathar
57033a0033 Move Crate into crate::core::metadata 2026-08-16 20:12:40 +10:00
Zalathar
9ff48b2147 Move TestTarget into build_steps::test 2026-08-16 20:12:40 +10:00
Zalathar
38c260e1f7 Move CodegenBackendKind to its own module crate::core::backend 2026-08-16 20:12:40 +10:00
Zalathar
96123571d2 Move Compiler to its own module crate::core::compiler 2026-08-16 20:12:38 +10:00
Ralf Jung
6c9c80c9be Merge pull request #5252 from saethlin/rustup
Rustup
2026-08-16 10:05:07 +00:00
Ralf Jung
148cb752a3 bless and fix tests 2026-08-16 11:34:35 +02:00
joboet
6d635dad07 std: guard against unwinds in queue-based Once 2026-08-16 11:28:00 +02:00
Ben Kimock
b77b9cf2c3 fmt, clippy 2026-08-16 10:34:24 +02:00
Ralf Jung
74a475963f Merge ref '67854e511de2' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: rust-lang/rust@67854e511d
Filtered ref: rust-lang/miri@c0147d96a2
Upstream diff: 4667d75565...67854e511d

This merge was created using https://github.com/rust-lang/josh-sync.
2026-08-16 10:31:20 +02:00
Ralf Jung
8677009733 Prepare for merging from rust-lang/rust
This updates the rust-version file to 67854e511d.
2026-08-16 10:29:41 +02:00
vad
5e54aa26a0 Pin all kernel links to the v6.13 2026-08-16 09:28:30 +02:00
bors
eab115ea6d Auto merge of #160331 - Walnut356:pretty-std-repr, r=Kobzol
Convert `tests/debuginfo/pretty-std.rs` to `lldb-repr`



Two things of note:

* I had to fix another small issue with msvc template args
* Enabling this test on `windows-gnu` caused the GDB test to fail because GDB decodes the emoji to raw bytes when working with wtf-8 strings. There's not an easy way to handle wtf-8 in python i think? So i just replaced the emoji with a wildcard. The target-specific differences should also fix itself once `gdb-repr` is implemented

r? @jieyouxu, @Kobzol 

---

try-job: aarch64-apple*
try-job: aarch64-apple-macos-26*
2026-08-16 07:20:07 +00:00
vad
ea31c35e77 Remove the "no-op" word from panic handler description
It's confusing, and the next paragraph explains what's exactly
happening.
2026-08-16 09:14:50 +02:00
vad
3da3659c07 Fix the link to the BPF ABI convention 2026-08-16 09:12:42 +02:00
vad
7e27076043 Mention the plan of using GNU flabor of linker 2026-08-16 09:10:47 +02:00
vad
43620bc5ef Describe Linux kernel version reqirements 2026-08-16 09:05:07 +02:00
Zalathar
73960bfc3c Move EXTRA_CHECK_CFGS into crate::core::builder::cargo 2026-08-16 14:46:27 +10:00
Zalathar
f955803a50 Move LLVM_TOOLS and LLD_FILE_NAMES into build_steps::dist
This seems to be the module that relies on them the most, and other modules
already pull in things from `dist`.
2026-08-16 14:46:17 +10:00