Skip to content

Rollup of 6 pull requests#156035

Closed
JonathanBrouwer wants to merge 15 commits intorust-lang:mainfrom
JonathanBrouwer:rollup-K13eF8a
Closed

Rollup of 6 pull requests#156035
JonathanBrouwer wants to merge 15 commits intorust-lang:mainfrom
JonathanBrouwer:rollup-K13eF8a

Conversation

@JonathanBrouwer
Copy link
Copy Markdown
Contributor

Successful merges:

r? @ghost

Create a similar rollup

Flakebi and others added 15 commits March 24, 2026 11:00
GPU targets have convergent operations that must not be duplicated or
moved in or out of control-flow.
An example convergent operation is a barrier/syncthreads.

The only MIR pass affected by this is jump-threading, it can duplicate
calls. Disable jump-hreading for GPU targets to prevent generating
incorrect code.

This affects the amdgpu and nvptx targets.
Fails on NLL, passes on polonius alpha & legacy.
This allows embedding source code even when it's only available via
previously emitted metadata files.

Without this, embedded source availability is inconsistent, especially
in release builds.
RFC 430 says type parameters should be named "concise UpperCamelCase,
usually single uppercase letter". So either `Key` or `K` is more
appropriate than `KEY`, which looks like a constant.

I chose `K` because it's a well-known abbreviation of "key" used in lots
of places, e.g. `HashMap<K, V>`.
It currently returns a `Vec` but in practice it always has one
diagnostic in it.

LLM disclosure: Claude Code identified this when I asked it to review
`tokentrees.rs`. I made the change by hand and tested it myself.
…=nnethercote

Do not run jump-threading for GPUs

GPU targets have convergent operations that must not be duplicated or
moved in or out of control-flow.
An example convergent operation is a barrier/syncthreads.

The only MIR pass affected by this is jump-threading, it can duplicate
calls. Disable jump-hreading for GPU targets to prevent generating
incorrect code.

This affects the amdgpu and nvptx targets.

Fixes rust-lang#137086, see this issue for details.
Tracking issue: rust-lang#135024

cc @RDambrosio016 @kjetilkjeka for nvptx
cc @ZuseZ4
…, r=petrochenkov,mu001999

Fix order-dependent visibility diagnostics

Fixes rust-lang#40066.
Fixes rust-lang#109657.
Delay visibility path diagnostics until module collection has finished, so paths to later non-ancestor modules report E0742 instead of an unresolved path error.
…us-ui-tests, r=jackh726

Adds a couple UI tests for polonius

I went through all the open issues labeled `fixed-by-polonius` and from that created two UI tests based on issues that seemed a little novel.
One for rust-lang#92038 and another for rust-lang#70044.
Both tests fail under NLL but pass with polonius (legacy and alpha).
…l-source, r=oli-obk

-Zembed-source: also embed external source

Hi,

I've been using `-Zembed-source` for a while and noticed that some sources are not embedded when compiling in release mode. See the minimal reproducer below for missing embedded source code.

The current implementation only emits source from the `src` field in `SourceFile`, but for multi-codegen-unit scenarios the source might only be available via the `external_src` field.

I've updated the LLVM and Cranelift backends to fall back to `external_src` if `src` is not available.

Minimal reproducer:
```console
$ cat Cargo.toml
[package]
name = "repro"
version = "0.0.1"
edition = "2021"
[profile.release]
strip = "none"
debug = true
$ cat src/lib.rs
// marker comment
pub fn foo() -> u64 { 42 }
$ cat src/main.rs
fn main() {
    println!("{}", repro::foo());
}
$ RUSTFLAGS="-g -Zembed-source=yes -Zdwarf-version=5" cargo build -r
   Compiling repro v0.0.1 (/tmp/repro)
    Finished `release` profile [optimized + debuginfo] target(s) in 0.08s
$ # Note: Source for lib.rs is missing here:
$ llvm-dwarfdump --debug-line target/release/repro | grep "marker comment"
$ RUSTFLAGS="-g -Zembed-source=yes -Zdwarf-version=5" cargo +stage1 build -r
    Finished `release` profile [optimized + debuginfo] target(s) in 0.04s
$ llvm-dwarfdump --debug-line target/release/repro | grep "marker comment"
         source: "// marker comment\npub fn foo() -> u64 { 42 }\n"
```

Thanks!
Feed cleanups

Two minor improvements. Details in the individual commits.

r? @oli-obk
…nyukang

Return a single diagnostic from `lex_token_trees`.

It currently returns a `Vec` but in practice it always has one diagnostic in it.

LLM disclosure: Claude Code identified this when I asked it to review `tokentrees.rs`. I made the change by hand and tested it myself.

r? @chenyukang
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label May 1, 2026
@rustbot rustbot added A-compiletest Area: The compiletest test runner A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-rustc-dev-guide Area: rustc-dev-guide A-testsuite Area: The testsuite used to check the correctness of rustc 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) 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. labels May 1, 2026
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-compiletest Area: The compiletest test runner A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-rustc-dev-guide Area: rustc-dev-guide A-testsuite Area: The testsuite used to check the correctness of rustc 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants