Skip to content

Rollup of 14 pull requests#153507

Merged
rust-bors[bot] merged 92 commits intorust-lang:mainfrom
JonathanBrouwer:rollup-ki59UTE
Mar 6, 2026
Merged

Rollup of 14 pull requests#153507
rust-bors[bot] merged 92 commits intorust-lang:mainfrom
JonathanBrouwer:rollup-ki59UTE

Conversation

@JonathanBrouwer
Copy link
Contributor

Successful merges:

r? @ghost

Create a similar rollup

chenyukang and others added 30 commits January 18, 2026 11:16
both operands of binary operators (including compound assignments like
`+=`) were inferred with `ExprIsRead::No`, which prevented divergence
detection for place expressions of type `!`. this caused false type
mismatches when a function's return type depended on the block diverging
after something like `x += *never_ptr` or `let _ = *never_ptr + 1`.
both operands of any binary operator are always consumed (read), so this
uses `ExprIsRead::Yes` to be consistent with the ordinary assignment and
let binding paths.
Signed-off-by: arferreira <arfs.antonio@gmail.com>
Co-authored-by: Esteban Kuber <estebank@users.noreply.github.com>
Example
---
```rust
fn main() {
    match 2 {
        bar => &bar.l$0
    }
}
```

**Before this PR**

```text
sn deref         *expr
sn match match expr {}
```

**After this PR**

```text
sn deref         *expr
sn let             let
sn letm        let mut
sn match match expr {}
```
Example
---
```rust
struct Foo { bar: i32, baz: i32 }

impl Foo {
    fn foo(&mut $0self) {
        self.bar = 5;
    }
}
```

**Before this PR**

Assist not applicable

**After this PR**

```rust
struct Foo { bar: i32, baz: i32 }

impl Foo {
    fn foo(&mut self) {
        let Foo { bar, baz } = self;
        *bar = 5;
    }
}
```
- Remove unused `ast::make::match_arm_with_guard`

Example
---
```rust
fn main() {
    if true {
        $0if true
            && false
        {
            foo()
        }
    }
}
```

**Before this PR**

```rust
fn main() {
    if true {
        match true
            && false {
            true => foo(),
            false => (),
        }
    }
}
```

**After this PR**

```rust
fn main() {
    if true {
        match true
            && false
        {
            true => foo(),
            false => (),
        }
    }
}
```
Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.1.2 to 3.1.5.
- [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md)
- [Commits](isaacs/minimatch@v3.1.2...v3.1.5)

---
updated-dependencies:
- dependency-name: minimatch
  dependency-version: 3.1.5
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
fix: Fix wrong confiditon in `Visibility::min`
…er-coercion

fix: use `ExprIsRead::Yes` for rhs of binary operators
…yarn/editors/code/minimatch-3.1.5

build(deps-dev): bump minimatch from 3.1.2 to 3.1.5 in /editors/code
Example
---
```rust
macro_rules! m { ($expr:expr) => {$expr}}
enum Test {
    A,
    B,
    C,
}

fn foo(t: Test) {
    m!(match t {
        Test::A => (),
    $0});
}
```

**Before this PR**

Assist not applicable

**After this PR**

```rust
macro_rules! m { ($expr:expr) => {$expr}}
enum Test {
    A,
    B,
    C,
}

fn foo(t: Test) {
    m!(match t {
        Test::A=>(),
        Test::B => ${1:todo!()},
        Test::C => ${2:todo!()},$0
    });
}
```
This updates the rust-version file to e7d90c6.
rust-analyzer allows AI usage (see rust-lang#21314), but requires contributors
to declare usage. This adds a rule file that improves LLM output
quality and instructs the LLM to declare usage in commit messages.

I've written the rules in CLAUDE.md, but also symlinked it to
AGENTS.md so other LLM tools pick it up.

## Rules file contents

(1) Instructions for both humans and AIs to declare AI usage.

(2) Relevant commands for testing, linting and codegen.

Note that I deliberately didn't include an overview of the project
structure on a folder-by-folder basis. This can go stale, and there's
some evidence that project structure can hurt LLM output quality
overall.

See the following paper:

> Evaluating AGENTS.md:
> Are Repository-Level Context Files Helpful for Coding Agents?
> https://arxiv.org/pdf/2602.11988

## Testing

I exercised this change with the following contrived prompt. Note that
in practice rust-analyzer is hitting review scaling limits for new
code actions, but it was easy to test end-to-end.

> Add a new code action that replaces the content of a string literal
> with the text "banana".
...
> commit it

This produced a functional code action with both Codex and Claude, and
in both cases the commit message mentioned that it was AI
generated. Example commit message:

    Add "Replace string with banana" code action

    Add a new assist that replaces a string literal's content with "banana"
    when the cursor is on a STRING token.

    AI: Generated with Claude Code (claude-opus-4-6).

I confirmed that the code action worked by testing a rust-analyzer
build in Emacs, and also confirmed that the generated tests looked
sensible.

## AI Usage Disclosures

I wrote the first draft of the rules file with Opus 4.6, manually
reviewed everything.
…nd-range

fix: Fix wrong descend range for add_missing_match_arms
…s-rust

Fix: align `is_rust()` with rustc by correcting constructor ABI in next solver
…fmease

Preserve parentheses around `Fn` trait bounds in pretty printer

The AST pretty printer was dropping parentheses around `Fn` trait bounds in `dyn`/`impl` types when additional `+` bounds were present. For example:

    dyn (FnMut(&mut T) -> &mut dyn ResourceLimiter) + Send + Sync

was pretty-printed as:

    dyn FnMut(&mut T) -> &mut dyn ResourceLimiter + Send + Sync

Without parens, `+ Send + Sync` binds to the inner `dyn ResourceLimiter` instead of the outer type, producing invalid Rust.

The parser already tracks parentheses via `PolyTraitRef.parens`, but `print_poly_trait_ref` never checked this field. This adds `popen()` and `pclose()` calls when `parens == Parens::Yes`.
@rust-bors rust-bors bot added the rollup A PR which is a rollup label Mar 6, 2026
@rustbot rustbot added A-attributes Area: Attributes (`#[…]`, `#![…]`) A-meta Area: Issues & PRs about the rust-lang/rust repository itself 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-clippy Relevant to the Clippy team. 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-rust-analyzer Relevant to the rust-analyzer team, which will review and decide on the PR/issue. T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue. labels Mar 6, 2026
@JonathanBrouwer
Copy link
Contributor Author

@bors r+ rollup=never p=5

@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 6, 2026

📌 Commit 03a8ae8 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 Mar 6, 2026
@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 Mar 6, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Mar 6, 2026

☀️ Test successful - CI
Approved by: JonathanBrouwer
Duration: 3h 19m 56s
Pushing 80282b1 to main...

@rust-bors rust-bors bot merged commit 80282b1 into rust-lang:main Mar 6, 2026
12 checks passed
@rustbot rustbot added this to the 1.96.0 milestone Mar 6, 2026
@rust-bors rust-bors bot mentioned this pull request Mar 6, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 6, 2026

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 a3ac2f2 (parent) -> 80282b1 (this PR)

Test differences

Show 119 test diffs

Stage 0

  • goto_definition::tests::question_mark_on_result_goes_to_conversion: [missing] -> pass (J1)
  • handlers::destructure_struct_binding::tests::mut_self_param: [missing] -> pass (J1)
  • handlers::destructure_struct_binding::tests::ref_mut_self_param: [missing] -> pass (J1)
  • handlers::destructure_struct_binding::tests::ref_self_param: [missing] -> pass (J1)
  • tests::expression::rpitit_with_reference: [missing] -> pass (J1)
  • tests::never_type::binop_lhs_never_place_diverges: [missing] -> pass (J1)
  • tests::never_type::binop_rhs_never_place_diverges: [missing] -> pass (J1)
  • tests::never_type::never_coercion_in_struct_update_syntax: [missing] -> pass (J1)
  • tests::regression::regression_21742: [missing] -> pass (J1)
  • tests::traits::enum_variant_constructor_as_fn_trait: [missing] -> pass (J1)
  • tests::traits::tuple_struct_constructor_as_fn_trait: [missing] -> pass (J1)

Stage 1

  • goto_definition::tests::question_mark_on_result_goes_to_conversion: [missing] -> pass (J0)
  • handlers::destructure_struct_binding::tests::mut_self_param: [missing] -> pass (J0)
  • handlers::destructure_struct_binding::tests::ref_mut_self_param: [missing] -> pass (J0)
  • handlers::destructure_struct_binding::tests::ref_self_param: [missing] -> pass (J0)
  • tests::expression::rpitit_with_reference: [missing] -> pass (J0)
  • tests::never_type::binop_lhs_never_place_diverges: [missing] -> pass (J0)
  • tests::never_type::binop_rhs_never_place_diverges: [missing] -> pass (J0)
  • tests::never_type::never_coercion_in_struct_update_syntax: [missing] -> pass (J0)
  • tests::regression::regression_21742: [missing] -> pass (J0)
  • tests::traits::enum_variant_constructor_as_fn_trait: [missing] -> pass (J0)
  • tests::traits::tuple_struct_constructor_as_fn_trait: [missing] -> pass (J0)
  • [pretty] tests/pretty/paren-trait-bound.rs: [missing] -> pass (J1)
  • [ui] tests/ui/const-generics/type-const-ice-issue-151631.rs: [missing] -> pass (J1)
  • [ui] tests/ui/moves/invalid-suggestions-destructuring-assignment-drop.rs: [missing] -> pass (J1)
  • [ui] tests/ui/offset-of/offset-of-error-recovery.rs: [missing] -> pass (J1)
  • [ui] tests/ui/privacy/inaccessible-private-fields-trailing-comma-149787.rs: [missing] -> pass (J1)

Stage 2

  • [ui] tests/ui/const-generics/type-const-ice-issue-151631.rs: [missing] -> pass (J2)
  • [ui] tests/ui/moves/invalid-suggestions-destructuring-assignment-drop.rs: [missing] -> pass (J2)
  • [ui] tests/ui/offset-of/offset-of-error-recovery.rs: [missing] -> pass (J2)
  • [ui] tests/ui/privacy/inaccessible-private-fields-trailing-comma-149787.rs: [missing] -> pass (J2)
  • [pretty] tests/pretty/paren-trait-bound.rs: [missing] -> pass (J3)

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

Job group index

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 80282b130679a654eaa22f028a908c51be53d436 --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. pr-check-1: 27m -> 35m 8s (+30.1%)
  2. aarch64-apple: 4h 20m -> 3h 10m (-26.9%)
  3. x86_64-rust-for-linux: 41m 49s -> 52m 30s (+25.6%)
  4. x86_64-gnu-llvm-21-3: 1h 39m -> 1h 58m (+19.6%)
  5. pr-check-2: 38m 15s -> 44m 45s (+17.0%)
  6. dist-apple-various: 1h 38m -> 1h 54m (+16.5%)
  7. x86_64-gnu-gcc: 1h -> 1h 9m (+15.1%)
  8. i686-gnu-nopt-1: 2h 1m -> 2h 19m (+14.8%)
  9. aarch64-gnu-llvm-20-2: 45m 52s -> 52m 26s (+14.3%)
  10. test-various: 1h 55m -> 2h 11m (+13.9%)
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

📌 Perf builds for each rolled up PR:

PR# Message Perf Build Sha
#151280 Fix incorrect trailing comma suggested in no_accessible_fie… d953cfe93ff583bea562a993f4615df0d71f3c65 (link)
#152040 Do not emit ConstEvaluatable goals if type-const 8b50b3622cf23b7cf17425e19e38aea7acebbc31 (link)
#152593 Box in ValTreeKind::Branch(Box<[I::Const]>) changed to `L… 4a2d390b55c542f601f49e1ef4e2c884f9239f7f (link)
#152741 Suppress invalid suggestions in destructuring assignment 7a92e35eb80e0eee14eea2dac71e2a02dc57e19c (link)
#153174 std: add wasm64 to sync::Once and thread_parking atomics cf… 498a82ac1b24cd59126fbb461ed6bf8e8cf02265 (link)
#153189 refactor: move check_align to parse_alignment d3219ef0922154852881f7e7b905a864d5e1c709 (link)
#153230 Roll rustfmt reviewers for in-tree rustfmt dcb22ed32063bbf57b268e5419080502621c1a41 (link)
#153445 Consider try blocks as block-like for overflowed expr b07976f9e18e91690701aebb97e3a5de4c874534 (link)
#153452 Cleanup unused diagnostic emission methods 732d787d211d0b3dd53473fc5eac132741769098 (link)
#153466 rust-analyzer subtree update 48f649da643899bb892b41051dc5f4a546a90101 (link)
#153476 bootstrap.py: fix typo "parallle" c5469cf6e7687ce13f69250be51ba492826f6bfd (link)
#153483 Preserve parentheses around Fn trait bounds in pretty pri… 081e10b2693846d02dc754d14e52bbf5c76813b3 (link)
#153485 libcore float tests: replace macro shadowing by const-compa… 29a3241d00b02cf120584bc8fb8452bd4f166d6a (link)
#153495 Fix ICE in offset_of! error recovery 58e257e5f41435b3ef9b2a0e25ef19cb7beb4708 (link)

previous master: a3ac2f21b3

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

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (80282b1): comparison URL.

Overall result: ❌✅ regressions and improvements - no action needed

@rustbot label: -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

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

Max RSS (memory usage)

Results (primary -0.1%, secondary 0.6%)

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

mean range count
Regressions ❌
(primary)
0.5% [0.5%, 0.5%] 1
Regressions ❌
(secondary)
2.9% [2.6%, 3.2%] 2
Improvements ✅
(primary)
-0.8% [-0.8%, -0.8%] 1
Improvements ✅
(secondary)
-3.9% [-3.9%, -3.9%] 1
All ❌✅ (primary) -0.1% [-0.8%, 0.5%] 2

Cycles

Results (primary 2.8%, secondary -0.2%)

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

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

Binary size

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

Bootstrap: 481.299s -> 482.9s (0.33%)
Artifact size: 395.15 MiB -> 397.22 MiB (0.52%)

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

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-meta Area: Issues & PRs about the rust-lang/rust repository itself 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-clippy Relevant to the Clippy team. 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-rust-analyzer Relevant to the rust-analyzer team, which will review and decide on the PR/issue. T-rustfmt Relevant to the rustfmt team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.