Skip to content

Rollup of 12 pull requests#153183

Merged
rust-bors[bot] merged 25 commits intorust-lang:mainfrom
JonathanBrouwer:rollup-APFHc2s
Feb 28, 2026
Merged

Rollup of 12 pull requests#153183
rust-bors[bot] merged 25 commits intorust-lang:mainfrom
JonathanBrouwer:rollup-APFHc2s

Conversation

@JonathanBrouwer
Copy link
Contributor

Successful merges:

r? @ghost

Create a similar rollup

sourcefrog and others added 25 commits January 31, 2026 21:14
Remove somewhat obvious comment about executing attacker-controlled programs.

Be more clear the examples are not exhaustive.
…affleLapkin

explicit tail calls: support indirect arguments

tracking issue: rust-lang#112788

After discussion in rust-lang#144855, I was wrong and it is actually possible to support tail calls with `PassMode::Indirect { on_stack: false, .. }` arguments.

Normally an indirect argument with `on_stack: false` would be passed as a pointer into the caller's stack frame. For tail calls, that would be unsound, because the caller's stack frame is overwritten by the callee's stack frame.

Therefore we store the argument for the callee in the corresponding caller's slot. Because guaranteed tail calls demand that the caller's signature matches the callee's, the corresponding slot has the correct type.

To handle cases like the one below, the tail call arguments must first be copied to a temporary, and can only then be copied to the caller's argument slots.

```rust
// A struct big enough that it is not passed via registers.
pub struct Big([u64; 4]);

fn swapper(a: Big, b: Big) -> (Big, Big) {
    become swapper_helper(b, a);
}
```

---

I'm not really familiar with MIR and what tricks/helpers we have, so I'm just cobbling this together. Hopefully we can arrive at something more elegant.
Stop using `LinkedGraph` in `lexical_region_resolve`

There are only two users of the older `LinkedGraph` data structure, and this is one.

It turns out that this diagnostic-related code doesn't need any non-trivial graph operations (since it does its own graph traversal); it just needs the ability to get a list of in-edges or out-edges (constraints) for any particular node. That's easy enough to do with a simple custom data structure.

Inspired by rust-lang#152621, which wants to make changes to `LinkedGraph` that wouldn't make sense for this use-site.
Clarify a confusing green-path function

The current name of this function, `try_load_from_disk_and_cache_in_memory`, is confusing on a number of levels:

- Trying to mark the node green is load-bearing even for queries that never cache to disk.
- It will only return None if it fails to mark the query green; the subsequent parts always return Some.
- If it cannot load a value from disk, it will obtain a value by invoking the query provider.
- It is not actually responsible for storing values in the in-memory cache; that is handled by an outer layer.

This PR therefore:
- Hoists the try-mark-green out of that function, making the function always return a value.
- Renames the function to `load_from_disk_or_invoke_provider_green `.
- Renames a few other local variables in passing.

There should be no change to compiler behaviour.
…dsmtm

Force a CI LLVM stamp bump

To see if this helps with rust-lang#153127.
…iper

Improved security section in rustdoc for `current_exe`

A few improvements to the security section of the docs about `current_exe`

0. The explanatory link <https://vulners.com/securityvulns/SECURITYVULNS:DOC:22183> is ~~broken~~ not directly very helpful in understanding the risk.
1. It basically previously says to never trust the result, which is IMO too pessimistic to be helpful. It's worth understanding the behavior but if you have a use case to re-exec the current program, which is not uncommon, this is a reasonable way to do it.
2. The particular risk is about setuid/setgid processes that shouldn't fully trust the user that spawned them.
3. IMO the most important risk with this function is that the invoker can control argv and PATH, so I made this more explicit. (Many unixes, including Linux, don't rely on them in the implementation, but some do.)
4. The previous text about TOCTOU and races is IMO not really coherent: if an attacker can write to the location where you're going to re-exec, they can fundamentally control what program is executed. They don't need to race with your execution of current_exe, and there is no up-front check.
5. Briefly explain the pattern of CVE-2009-1894: on Linux, depending on system configuration, an attacker who can create hardlinks to the executable can potentially control `/proc/self/exe`. On modern Linux this should normally require permission to write to the executable.

I did some web research for "argv0 vulnerability" and similar terms and didn't find anything else we should be documenting here. (There are issues about argc=0 but those should be prevented by memory safety in Rust.)

I found what the link seemed to be pointing to in <https://vulners.com/cve/CVE-2009-1894>, which talks about confusing a setuid program by creating a hardlink to its exe. I think this is in very particular circumstances something people should still be concerned about: a setuid program on a machine with `fs.protected_hardlinks = 0`. I don't think this justifies warning people not to use the function at all.

cc @mgeisler
rustc_public: rewrite `bridge_impl` to reduce boilerplate

It looks better.
rustc_public: remove the `CrateDefItems` trait

This trait feels sus since its documentation says it's for 'retrieving all items from a definition' however it only provides an `associated_items` method (??), which I believe should only be valid for `impl`s and `trait`s.
…essage, r=RalfJung

Fix mem::conjure_zst panic message to use any::type_name instead

Use `crate::any::type_name::<T>()` instead of `stringify!(T)` in the
runtime panic message of `conjure_zst` , so the actual type name (e.g.
`i32`) is shown rather than the literal string `[T]`.
…, r=GuillaumeGomez

Remove mutation from macro path URL construction

Resolves the `FIXME` in `generate_macro_def_id_path`.
The old code mutated `path` to build the URL — popping the macro name, pushing an interned filename, then restoring the original at the end. None of that was necessary. A slice pattern gives us `module_path` and `last` without touching the original, and `push_fmt(format_args!(...))` writes the filename directly into the URL builder, same as `make_href` already does.
Also tightened the error guards: the original `path.len() < 2` is now two distinct checks with messages that describe the actual failure (empty path vs. single-element path missing the crate prefix).

r? @GuillaumeGomez
…r=petrochenkov

Print path root when printing path

Extracted from rust-lang#152996.

r? petrochenkov
…rcote

Work around a false `err.emit();` type error in rust-analyzer

For whatever reason, rust-analyzer doesn't see that these calls to `err.emit();` are diverging, so the trailing semicolon makes r-a complain about a type mismatch between `()` and some other type.

Removing the trailing semicolon makes no functional difference (because the emit still unwinds the stack), but seems to be enough to allow rust-analyzer to see that emitting an error returns `!` in these cases, which silences the false error.
@rust-bors rust-bors bot added the rollup A PR which is a rollup label Feb 27, 2026
@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) F-explicit_tail_calls `#![feature(explicit_tail_calls)]` S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Feb 27, 2026
@rustbot rustbot added T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Feb 27, 2026
@JonathanBrouwer
Copy link
Contributor Author

@bors r+ rollup=never p=5

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 27, 2026

📌 Commit 70da804 has been approved by JonathanBrouwer

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 27, 2026
@JonathanBrouwer
Copy link
Contributor Author

Trying commonly failed jobs
@bors try jobs=test-various,x86_64-gnu-aux,x86_64-gnu-llvm-21-3,x86_64-msvc-1,aarch64-apple,x86_64-mingw-1

@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Feb 27, 2026
Rollup of 12 pull requests


try-job: test-various
try-job: x86_64-gnu-aux
try-job: x86_64-gnu-llvm-21-3
try-job: x86_64-msvc-1
try-job: aarch64-apple
try-job: x86_64-mingw-1
@jieyouxu

This comment was marked as outdated.

@rust-bors

This comment was marked as outdated.

@jieyouxu
Copy link
Member

@bors p=6

@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Feb 27, 2026
…uwer

Rollup of 12 pull requests

Successful merges:

 - #151143 (explicit tail calls: support indirect arguments)
 - #153012 (Stop using `LinkedGraph` in `lexical_region_resolve`)
 - #153175 (Clarify a confusing green-path function)
 - #153179 (Force a CI LLVM stamp bump)
 - #150828 (Improved security section in rustdoc for `current_exe`)
 - #152673 (rustc_public: rewrite `bridge_impl` to reduce boilerplate)
 - #152674 (rustc_public: remove the `CrateDefItems` trait)
 - #153073 (Fix mem::conjure_zst panic message to use any::type_name instead)
 - #153117 (Remove mutation from macro path URL construction)
 - #153128 (Recover feature lang_items for emscripten)
 - #153138 (Print path root when printing path)
 - #153159 (Work around a false `err.emit();` type error in rust-analyzer)
@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 27, 2026

☀️ Try build successful (CI)
Build commit: ecf56c4 (ecf56c4a337dfb9950103f3e38ab43437aadc160, parent: 6f54d591c3116ee7f8ce9321ddeca286810cc142)

@JonathanBrouwer
Copy link
Contributor Author

@bors cancel
Seems to be stuckkkkk :c

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 27, 2026

Auto build cancelled. Cancelled workflows:

The next pull request likely to be tested is #153183.

@rust-bors

This comment has been minimized.

@rust-bors rust-bors bot added merged-by-bors This PR was explicitly merged by bors. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Feb 28, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 28, 2026

☀️ Test successful - CI
Approved by: JonathanBrouwer
Duration: 3h 32m 16s
Pushing 67aec36 to main...

@rust-bors rust-bors bot merged commit 67aec36 into rust-lang:main Feb 28, 2026
13 checks passed
@rustbot rustbot added this to the 1.95.0 milestone Feb 28, 2026
@rust-timer
Copy link
Collaborator

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#150828 Improved security section in rustdoc for current_exe 3d5494e8be469d028ce5e4f633bf7ac6e1d7599e (link)
#151143 explicit tail calls: support indirect arguments 42ad15ce6416f003fb09354c8bca08c2fe4d04ab (link)
#152673 rustc_public: rewrite bridge_impl to reduce boilerplate 944ce2924d8c9beed6b4092cddfdade95c257ff1 (link)
#152674 rustc_public: remove the CrateDefItems trait e84d5bf4dcdefaea4c42fee7342ec7661767a048 (link)
#153012 Stop using LinkedGraph in lexical_region_resolve d20531248078293df4af659517c60df0b72df9d1 (link)
#153073 Fix mem::conjure_zst panic message to use any::type_name in… 64a8176cb8be648417c8a7b8ee9e27bd3478a0c8 (link)
#153117 Remove mutation from macro path URL construction 3ee311db11835b5a60f2f26edc7987c5f595d471 (link)
#153128 Recover feature lang_items for emscripten 9e9654a99feebc3d9bbc340bf41240534b8d0c55 (link)
#153138 Print path root when printing path 1a92c7e814644ede21d051a51f4401a9d11853c7 (link)
#153159 Work around a false err.emit(); type error in rust-analyz… c82efbb928b86a4a7ce898d6a0931fe253232366 (link)
#153175 Clarify a confusing green-path function 4057017fb275895306f6381d3a6f90837bc853e9 (link)
#153179 Force a CI LLVM stamp bump c9e231c414e12c3f2b7ab054f4bfa109e4c80d6d (link)

previous master: 3a70d0349f

In the case of a perf regression, run the following command for each PR you suspect might be the cause: @rust-timer build $SHA

@github-actions
Copy link
Contributor

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 3a70d03 (parent) -> 67aec36 (this PR)

Test differences

Show 40 test diffs

Stage 1

  • [codegen] tests/codegen-llvm/tail-call-u128.rs#linux: [missing] -> pass (J0)
  • [codegen] tests/codegen-llvm/tail-call-u128.rs#win: [missing] -> pass (J0)
  • [assembly] tests/assembly-llvm/tail-call-indirect.rs: [missing] -> ignore (ignored when the LLVM version 20.1.2 is older than 22.0.0) (J1)
  • [codegen] tests/codegen-llvm/tail-call-u128.rs#linux: [missing] -> ignore (ignored when the LLVM version 20.1.2 is older than 22.0.0) (J1)
  • [codegen] tests/codegen-llvm/tail-call-u128.rs#win: [missing] -> ignore (ignored when the LLVM version 20.1.2 is older than 22.0.0) (J1)
  • [crashes] tests/crashes/144293-indirect-ops-llvm.rs: pass -> [missing] (J4)
  • [ui] tests/ui/explicit-tail-calls/indirect.rs: [missing] -> pass (J4)
  • [assembly] tests/assembly-llvm/tail-call-indirect.rs: [missing] -> ignore (ignored when the LLVM version 21.1.2 is older than 22.0.0) (J9)
  • [codegen] tests/codegen-llvm/tail-call-u128.rs#linux: [missing] -> ignore (ignored when the LLVM version 21.1.2 is older than 22.0.0) (J9)
  • [codegen] tests/codegen-llvm/tail-call-u128.rs#win: [missing] -> ignore (ignored when the LLVM version 21.1.2 is older than 22.0.0) (J9)

Stage 2

  • [assembly] tests/assembly-llvm/tail-call-indirect.rs: [missing] -> pass (J2)
  • [codegen] tests/codegen-llvm/tail-call-u128.rs#linux: [missing] -> pass (J2)
  • [codegen] tests/codegen-llvm/tail-call-u128.rs#win: [missing] -> pass (J2)
  • [assembly] tests/assembly-llvm/tail-call-indirect.rs: [missing] -> ignore (ignored when the LLVM version 20.1.2 is older than 22.0.0) (J3)
  • [codegen] tests/codegen-llvm/tail-call-u128.rs#linux: [missing] -> ignore (ignored when the LLVM version 20.1.2 is older than 22.0.0) (J3)
  • [codegen] tests/codegen-llvm/tail-call-u128.rs#win: [missing] -> ignore (ignored when the LLVM version 20.1.2 is older than 22.0.0) (J3)
  • [ui] tests/ui/explicit-tail-calls/indirect.rs: [missing] -> ignore (gcc backend is marked as ignore) (J5)
  • [crashes] tests/crashes/144293-indirect-ops-llvm.rs: pass -> [missing] (J6)
  • [assembly] tests/assembly-llvm/tail-call-indirect.rs: [missing] -> ignore (ignored when the LLVM version 20.1.8 is older than 22.0.0) (J7)
  • [codegen] tests/codegen-llvm/tail-call-u128.rs#linux: [missing] -> ignore (ignored when the LLVM version 20.1.8 is older than 22.0.0) (J7)
  • [codegen] tests/codegen-llvm/tail-call-u128.rs#win: [missing] -> ignore (ignored when the LLVM version 20.1.8 is older than 22.0.0) (J7)
  • [assembly] tests/assembly-llvm/tail-call-indirect.rs: [missing] -> ignore (ignored when the LLVM version 21.1.2 is older than 22.0.0) (J8)
  • [codegen] tests/codegen-llvm/tail-call-u128.rs#linux: [missing] -> ignore (ignored when the LLVM version 21.1.2 is older than 22.0.0) (J8)
  • [codegen] tests/codegen-llvm/tail-call-u128.rs#win: [missing] -> ignore (ignored when the LLVM version 21.1.2 is older than 22.0.0) (J8)
  • [ui] tests/ui/explicit-tail-calls/indirect.rs: [missing] -> pass (J10)
  • [run-make] tests/run-make/compressed-debuginfo-zstd: pass -> ignore (ignored if LLVM wasn't build with zstd for ELF section compression or LLVM is not the default codegen backend) (J11)

Additionally, 14 doctest diffs were found. These are ignored, as they are noisy.

Job group index

  • J0: pr-check-2
  • J1: x86_64-gnu-llvm-20-3
  • J2: aarch64-apple, aarch64-gnu, aarch64-msvc-1, arm-android, armhf-gnu, dist-i586-gnu-i586-i686-musl, i686-gnu-1, i686-gnu-nopt-1, i686-msvc-1, test-various, x86_64-gnu, x86_64-gnu-nopt, x86_64-gnu-stable, x86_64-mingw-1, x86_64-msvc-1
  • J3: x86_64-gnu-llvm-20-2
  • J4: x86_64-gnu-llvm-20-3, x86_64-gnu-llvm-21-3
  • J5: x86_64-gnu-gcc
  • J6: aarch64-apple, aarch64-gnu, aarch64-gnu-llvm-20-1, aarch64-msvc-1, arm-android, armhf-gnu, dist-i586-gnu-i586-i686-musl, i686-gnu-1, i686-gnu-nopt-1, i686-msvc-1, test-various, x86_64-gnu, x86_64-gnu-gcc, x86_64-gnu-llvm-20-2, x86_64-gnu-llvm-21-2, x86_64-gnu-nopt, x86_64-gnu-stable, x86_64-mingw-1, x86_64-msvc-1
  • J7: aarch64-gnu-llvm-20-1
  • J8: x86_64-gnu-llvm-21-2
  • J9: x86_64-gnu-llvm-21-3
  • J10: aarch64-apple, aarch64-gnu, aarch64-gnu-llvm-20-1, aarch64-msvc-1, arm-android, armhf-gnu, dist-i586-gnu-i586-i686-musl, i686-gnu-1, i686-gnu-nopt-1, i686-msvc-1, test-various, x86_64-gnu, x86_64-gnu-debug, x86_64-gnu-llvm-20, x86_64-gnu-llvm-20-2, x86_64-gnu-llvm-21-2, x86_64-gnu-nopt, x86_64-gnu-stable, x86_64-mingw-1, x86_64-msvc-1
  • J11: x86_64-gnu-nopt
Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 67aec36df76a7b67b71a8ee47684467e16f1847e --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. dist-aarch64-apple: 1h 46m -> 2h 47m (+56.8%)
  2. x86_64-gnu-tools: 52m 18s -> 1h 15m (+43.5%)
  3. x86_64-rust-for-linux: 45m 24s -> 1h 4m (+42.1%)
  4. pr-check-1: 27m 57s -> 36m 52s (+31.9%)
  5. pr-check-2: 39m 47s -> 50m 13s (+26.2%)
  6. x86_64-gnu-gcc: 1h 1m -> 1h 17m (+25.7%)
  7. armhf-gnu: 1h 23m -> 1h 40m (+20.1%)
  8. x86_64-gnu-miri: 1h 15m -> 1h 29m (+18.4%)
  9. test-various: 1h 56m -> 2h 16m (+18.0%)
  10. x86_64-gnu-nopt: 2h 24m -> 2h 50m (+17.8%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (67aec36): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results (secondary -2.8%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.8% [-2.8%, -2.8%] 1
All ❌✅ (primary) - - 0

Cycles

Results (primary -3.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-3.0% [-3.0%, -3.0%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -3.0% [-3.0%, -3.0%] 1

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 480.016s -> 480.397s (0.08%)
Artifact size: 397.55 MiB -> 397.57 MiB (0.01%)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) F-explicit_tail_calls `#![feature(explicit_tail_calls)]` merged-by-bors This PR was explicitly merged by bors. rollup A PR which is a rollup T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Projects

None yet

Development

Successfully merging this pull request may close these issues.