Skip to content

Rollup of 9 pull requests#154983

Closed
JonathanBrouwer wants to merge 77 commits intorust-lang:mainfrom
JonathanBrouwer:rollup-tCEMXY5
Closed

Rollup of 9 pull requests#154983
JonathanBrouwer wants to merge 77 commits intorust-lang:mainfrom
JonathanBrouwer:rollup-tCEMXY5

Conversation

@JonathanBrouwer
Copy link
Copy Markdown
Contributor

Successful merges:

r? @ghost

Create a similar rollup

Randl and others added 30 commits January 31, 2026 11:44
On targets with convergent operations, we need to add the convergent
attribute to all functions that run convergent operations. Following
clang, we can conservatively apply the attribute to all functions when
compiling for such a target and rely on LLVM optimizing away the
attribute in cases where it is not necessary.

This affects the amdgpu and nvptx targets.
- Specifically guide new contributors that unit tests for `core` and `alloc` do not belong within those crates and instead belong in the `coretests` and `alloctests` crates.
- Also add some information about which `lib.rs` file needs the unstable feature declarations
Update information about adding unit tests
Add explanation of default flags for UI tests
add chapter on projection vs trait split
Explain how nested generic args are represented
projection vs trait bound split cleanup
Change `ConstValue::ByRef` to `ConstValue::Indirect`
tshepang and others added 12 commits April 8, 2026 08:57
…hercote

Use convergent attribute to funcs for GPU targets

On targets with convergent operations, we need to add the convergent attribute to all functions that run convergent operations. Following clang, we can conservatively apply the attribute to all functions when compiling for such a target and rely on LLVM optimizing away the attribute in cases where it is not necessary.

This affects the amdgpu and nvptx targets.

cc @kjetilkjeka, @kulst for nvptx
cc @ZuseZ4

r? @nnethercote, as you already reviewed this in the other PR

Split out from rust-lang#149637, the part here should be uncontroversial.
constify DoubleEndedIterator

The only functions that can't be constified are `advance_back_by` (requires const range or const-hack), `nth_back` (requires `advance_back_by`), and `rfind` (requires const closures).

I've put it under `const_iter`, but I can open a separate tracking issue, though I think tracking all `Iterator` traits separately would be quite annoying, and we probably would prefer to constify them together anyway.
…nnethercote

Replace span_look_ahead with span_followed_by

While reviewing that PR rust-lang#154703 (comment), I found that magic number 100, let's remove it, and seems `span_followed_by` is a better name.
Don't store `pattern_ty` in `TestableCase`

This field's only remaining use was in an assertion, but we can perform the same assertion earlier when constructing `TestableCase::Range`.

---

For background, the `pattern_ty` field was introduced in rust-lang#136435 to replace a reference to the full THIR pattern node. Since then, most uses of `pattern_ty` were removed by rust-lang#150238.
…next-solver, r=TaKO8Ki

Fix ICE in next-solver dyn-compatibility check

The next solver treated error-containing dispatchability goals as proven and misclassified the trait as dyn compatible. Short-circuit receivers with type errors so object-method confirmation stays on the normal error path.

Tracking issue: rust-lang#130516
Closes: rust-lang#151311
…r=Nadrieril

Add getters for `rustc_pattern_analysis::constructor::Slice` fields

rust-analyzer needs that.

r? @Nadrieril
match exhaustiveness: Show the guard exhaustivity note only when it's the guards alone that cause non-exhaustiveness

Only show the "match arms with guards don't count towards exhaustivity" note when removing all guards would make the match exhaustive, but also in the cases when some arms don’t have guards. Previously, this note was shown whenever all arms had guards, but even if the patterns themselves were insufficient to cover all valid values of a type.

Do this by rerunning the exhaustiveness analysis with guards stripped to determine whether the guards are actually the cause of non-exhaustiveness. This only happens on an actual exhaustiveness error, so should not be a performance concern.

This will make a program like:

```rust
fn main() {
    let some_condition = true;
    let some_option: Option<u8> = None;

    let _res = match some_option {
        Some(val) if some_condition => val,
        None => 0,
    };
}
```

produce the note ”match arms with guards don't count towards exhaustivity” that previously would not have been appearing.

Closes rust-lang#104653 as I think this addresses the spirit of that issue. I don’t believe it’s necessary to be any more elaborate in the diagnostics here?
Use derived impl for `GappedRange` subdiagnostic
rustc-dev-guide subtree update

Subtree update of `rustc-dev-guide` to rust-lang/rustc-dev-guide@912f6c6.

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

r? @ghost
@rust-bors rust-bors bot added the rollup A PR which is a rollup label Apr 8, 2026
@rustbot rustbot added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-rustc-dev-guide Area: rustc-dev-guide S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. 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 Apr 8, 2026
@JonathanBrouwer
Copy link
Copy Markdown
Contributor Author

@bors r+ rollup=never p=5

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

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 8, 2026

📌 Commit 26d18b8 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 Apr 8, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 8, 2026

⌛ Trying commit 26d18b8 with merge 867de5e

To cancel the try build, run the command @bors try cancel.

Workflow: https://github.com/rust-lang/rust/actions/runs/24130325729

rust-bors bot pushed a commit that referenced this pull request Apr 8, 2026
Rollup of 9 pull requests


try-job: dist-various-1
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
@rust-bors rust-bors bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Apr 8, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 8, 2026

This pull request was unapproved due to being closed.

@JonathanBrouwer
Copy link
Copy Markdown
Contributor Author

@bors try cancel

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Apr 8, 2026

Try build cancelled. Cancelled workflows:

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

Labels

A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-rustc-dev-guide Area: rustc-dev-guide rollup A PR which is a rollup S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. 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.