Skip to content

Rollup of 13 pull requests#154253

Merged
rust-bors[bot] merged 156 commits intorust-lang:mainfrom
JonathanBrouwer:rollup-LLZUsz2
Mar 23, 2026
Merged

Rollup of 13 pull requests#154253
rust-bors[bot] merged 156 commits intorust-lang:mainfrom
JonathanBrouwer:rollup-LLZUsz2

Conversation

@JonathanBrouwer
Copy link
Copy Markdown
Contributor

Successful merges:

r? @ghost

Create a similar rollup

A4-Tacks and others added 30 commits September 3, 2025 07:28
Example
---
```rust
fn foo() {
    {
        let closure = |$0| match () {
            () => {},
        };
        closure();
    }
}
```

**Before this PR**:

```rust
fn foo() {
    {
        fn closure() {
            match () {
                    () => {},
                }
        }
        closure();
    }
}
```

**After this PR**:

```rust
fn foo() {
    {
        fn closure() {
            match () {
                () => {},
            }
        }
        closure();
    }
}
```
Example
---
```rust
fn main() {
    if $0let (foo, bar) = ("Foo", "Bar") {
        code();
    }
}
```
->
```rust
fn main() {
    if let foo = "Foo"
        && let bar = "Bar" {
        code();
    }
}
```
Example
---
```rust
fn main() {
    Foo { bar$0: false };
}
struct Foo {}
```
->
```rust
fn main() {
    Foo { bar: false };
}
struct Foo {
    bar: bool,
}
```
Example
---
```rust
pub struct Test {
    $0#[foo]
    #[bar]$0
    test: u32,
}
```
->
```rust
pub struct Test {
    #[cfg_attr($0, foo, bar)]
    test: u32,
}
```
Changes:

- Add nested lifetime support
- Add explicit infer lifetime support
- Change assist type to `quickfix`

Example
---
```rust
struct Foo {
    a: &$0i32,
    b: &'_ i32,
    c: (&i32, Bar<'_>),
}
```

**Before this PR**:

```rust
struct Foo<'a> {
    a: &'a i32,
    b: &'_ i32,
    c: (&i32, Bar<'_>),
}
```

**After this PR**:

```rust
struct Foo<'a> {
    a: &'a i32,
    b: &'a i32,
    c: (&'a i32, Bar<'a>),
}
```
Example
---
```rust
fn foo() {
    let None$0 = Some(5);
}
```

->

```rust
fn foo() {
    let None = Some(5) else { return };
}
```
Example
---
```rust
fn main() {
    for$0 _ in 0..5 {
        break;
        continue;
    }
}
```

**Before this PR**

Assist not applicable

**After this PR**

```rust
fn main() {
    'l: for _ in 0..5 {
        break 'l;
        continue 'l;
    }
}
```
Editor adds the current indentation to the content of the code snippet

This PR dedentation is used to offset the editor snippet indentation

Example
---
```rust
fn foo(x: Option<i32>, y: Option<i32>) {
    let _f = || {
        x
            .and(y)
            .map(|it| it+2)
            .$0
    };
}
```

**Before this PR**

```rust
fn foo(x: Option<i32>, y: Option<i32>) {
    let _f = || {
        let $0 = x
                        .and(y)
                        .map(|it| it+2);
    };
}
```

**After this PR**

```rust
fn foo(x: Option<i32>, y: Option<i32>) {
    let _f = || {
        let $0 = x
            .and(y)
            .map(|it| it+2);
    };
}
```
Example
---
```rust
struct Foo(Option<i32>);
fn foo(x: Foo) -> Foo {
   match x { Foo($0) => () }
}
```

**Before this PR**

```rust
ty: Foo, name: ?
```

**After this PR**

```rust
ty: Option<i32>, name: ?
```
fix replacing target on lib target kind
These are not used outside of the project-model crate, ie. instantly converted to other structures.
Makes clear to future editors of this code that they should add #[serde(default)]
to new fields.
I'm about to complete the match statement here with more of the same.
Once you write the exact same code 5 times, it's time for a helper function.
Was deleted when this code was moved in PR 18043.
Allows project JSON users  to run a whole module of tests, benchmarks, doctests.
Example
---
**Input**:

```rust
use std::fmt::Error;
$0use std::fmt::Display;
use std::fmt::Debug;
use std::fmt::Write;
use$0 std::fmt::Result;
```

**Before this PR**:

```rust
use std::fmt::Error;
use std::fmt::{Debug, Display, Write};
use std::fmt::Result;
```

**After this PR**:

```rust
use std::fmt::Error;
use std::fmt::{Debug, Display, Result, Write};
```
Example
---
```rust
fn main() {
    let Some(2) = None else {$0
        return;
    };
}
```

**Before this PR**

Assist not applicable

**After this PR**

```rust
fn main() {
    return;
}
```
Example
---
```rust
fn main() {
    let bar = 2;
    let f = || bar.$0;
}
```

**Before this PR**

Cannot complete `.let`

**After this PR**

```rust
fn main() {
    let bar = 2;
    let f = || {
        let $1 = bar;
        $0
    };
}
```
- Do not show commas on label

Example
---
```rust
fn f(foo: (), bar: u32) {}
fn g(foo: (), mut ba$0)
```

**Before this PR**

```rust
fn f(foo: (), bar: u32) {}
fn g(foo: (), bar: u32)
```

**After this PR**

```rust
fn f(foo: (), bar: u32) {}
fn g(foo: (), mut bar: u32)
```
Example
---
```rust
fn f() {
    if true
        && let xyz = 0
    {
        xyz$0;
    }
}
```

**Before this PR**

Assist not applicable

**After this PR**

```rust
fn f() {
    if true
    {
        0;
    }
}
```
seven IrPrint::print_debug implementations in the next-solver were
placeholder stubs that returned "TODO: <typename>" instead of meaningful
output. these are called via the Display impl (and Debug for PatternKind)
of these types, so any solver trace log containing them was unreadable.

implemented proper formatting for each:
- TraitPredicate      -> "T: Trait" / "!T: Trait"
- HostEffectPredicate -> "const T: Trait" / "[const] T: Trait"
- NormalizesTo        -> "AliasTerm(...) -> Term"
- SubtypePredicate    -> "A <: B"
- CoercePredicate     -> "A -> B"
- FnSig               -> "fn([inputs]) -> output"
- PatternKind         -> "start..=end" / "or([...])" / "!null"

also removed the now-unused type_name_of_val import.
- Fix parentheses for replace_is_method_with_if_let_method

Example
---
```rust
fn main() {
    let x = Some(1);
    if x.is_som$0e_and(predicate) {}
}
```

**Before this PR**

```rust
fn main() {
    let x = Some(1);
    if let Some(x1) = x {}
}
```

**After this PR**

```rust
fn main() {
    let x = Some(1);
    if let Some(x1) = x && predicate(x1) {}
}
```
…esent

load_workspace_at() looks at parent directories. If rust-analyzer is
in a directory (e.g. a monorepo) where a parent directory contains a
rust-project.json, that configuration wins over the Cargo.toml and the
test fails.

One easy way of testing this is deliberately writing an invalid JSON
file to the parent directory.

```
$ echo '{' > ../rust-project.json
$ cargo t -p load-cargo
---- tests::test_loading_rust_analyzer stdout ----

thread 'tests::test_loading_rust_analyzer' (38576150) panicked at crates/load-cargo/src/lib.rs:756:81:
called `Result::unwrap()` on an `Err` value: Failed to load the project at /Users/wilfred/src/rust-project.json

Caused by:
    0: Failed to deserialize json file /Users/wilfred/src/rust-project.json
    1: EOF while parsing an object at line 2 column 0
```

Instead, explicitly load the cargo workspace so the presence of a
rust-project.json never changes the result of the test.

AI disclosure: Written with help from Claude.
@rustbot rustbot added A-run-make Area: port run-make Makefiles to rmake.rs A-test-infra-minicore Area: `minicore` test auxiliary and `//@ add-core-stubs` 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Mar 23, 2026
@JonathanBrouwer
Copy link
Copy Markdown
Contributor Author

@bors r+ rollup=never p=3

@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Mar 23, 2026

📌 Commit 1448ab9 has been approved by JonathanBrouwer

It is now in the queue for this repository.

@JonathanBrouwer
Copy link
Copy Markdown
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 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 23, 2026
@rust-bors

This comment has been minimized.

rust-bors bot pushed a commit that referenced this pull request Mar 23, 2026
Rollup of 13 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
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Mar 23, 2026

☀️ Try build successful (CI)
Build commit: 7805927 (7805927f3b2c9f27411e16075ec06496fc0b307d, parent: bbe853615821442ef11d6cd42a30a73432b38d89)

@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 23, 2026
@rust-bors
Copy link
Copy Markdown
Contributor

rust-bors bot commented Mar 23, 2026

☀️ Test successful - CI
Approved by: JonathanBrouwer
Duration: 3h 20m 2s
Pushing eb9d3ca to main...

@rust-bors rust-bors bot merged commit eb9d3ca into rust-lang:main Mar 23, 2026
13 checks passed
@rustbot rustbot added this to the 1.96.0 milestone Mar 23, 2026
@github-actions
Copy link
Copy Markdown
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 13e2aba (parent) -> eb9d3ca (this PR)

Test differences

Show 102 test diffs

Stage 0

  • completions::postfix::tests::closure_let_block: [missing] -> pass (J0)
  • completions::postfix::tests::let_before_semicolon: [missing] -> pass (J0)
  • completions::postfix::tests::snippet_dedent: [missing] -> pass (J0)
  • context::tests::expected_type_tuple_struct_pat: [missing] -> pass (J0)
  • handlers::add_braces::tests::suggest_add_braces_for_const_initializer: [missing] -> pass (J0)
  • handlers::add_braces::tests::suggest_add_braces_for_static_initializer: [missing] -> pass (J0)
  • handlers::add_label_to_loop::tests::add_label_to_for_expr: [missing] -> pass (J0)
  • handlers::add_label_to_loop::tests::add_label_to_while_expr: [missing] -> pass (J0)
  • handlers::add_label_to_loop::tests::do_not_add_label_if_outside_keyword: [missing] -> pass (J0)
  • handlers::add_lifetime_to_type::tests::add_lifetime_to_explicit_infer_lifetime: [missing] -> pass (J0)
  • handlers::add_lifetime_to_type::tests::add_lifetime_to_nested_types: [missing] -> pass (J0)
  • handlers::add_missing_match_arms::tests::add_missing_match_arms_end_of_last_empty_arm: [missing] -> pass (J0)
  • handlers::convert_named_struct_to_tuple_struct::tests::convert_constructor_expr_uses_self: [missing] -> pass (J0)
  • handlers::convert_named_struct_to_tuple_struct::tests::convert_pat_uses_self: [missing] -> pass (J0)
  • handlers::convert_tuple_struct_to_named_struct::tests::convert_expr_uses_self: [missing] -> pass (J0)
  • handlers::convert_tuple_struct_to_named_struct::tests::convert_pat_uses_self: [missing] -> ignore (FIXME overlap edits in nested uses self) (J0)
  • handlers::extract_variable::tests::extract_non_local_path_expr: [missing] -> pass (J0)
  • handlers::generate_trait_from_impl::tests::test_multi_fn_impl_not_suggest_trait_name: [missing] -> pass (J0)
  • handlers::generate_trait_from_impl::tests::test_remove_doc_comments: [missing] -> pass (J0)
  • handlers::inline_local_variable::tests::let_expr_works_on_local_usage: [missing] -> pass (J0)
  • handlers::inline_local_variable::tests::test_inline_let_expr: [missing] -> pass (J0)
  • handlers::inline_type_alias::test::inline_types_with_lifetime: [missing] -> pass (J0)
  • handlers::inline_type_alias::test::mixed_lifetime_and_type_args: [missing] -> pass (J0)
  • handlers::merge_imports::tests::merge_partial_selection_uses: [missing] -> pass (J0)
  • handlers::no_such_field::tests::test_add_field_from_usage_with_empty_struct: [missing] -> pass (J0)
  • handlers::non_exhaustive_let::tests::fix_return_in_closure: [missing] -> pass (J0)
  • handlers::non_exhaustive_let::tests::fix_return_in_fn: [missing] -> pass (J0)
  • handlers::non_exhaustive_let::tests::fix_return_in_incomplete_let: [missing] -> pass (J0)
  • handlers::non_exhaustive_let::tests::fix_return_in_loop: [missing] -> pass (J0)
  • handlers::non_exhaustive_let::tests::fix_return_in_macro_expanded: [missing] -> pass (J0)
  • handlers::non_exhaustive_let::tests::fix_return_try_in_fn: [missing] -> pass (J0)
  • handlers::unwrap_block::tests::simple_let_else: [missing] -> pass (J0)
  • handlers::unwrap_tuple::tests::unwrap_tuples_in_let_expr: [missing] -> pass (J0)
  • tests::rust_project_labeled_project_model: [missing] -> pass (J0)
  • tests::test_dedent: [missing] -> pass (J0)
  • tests::test_indent_of: [missing] -> pass (J0)

Stage 1

  • [pretty] tests/pretty/or-pattern-paren.rs: [missing] -> pass (J0)
  • [ui] tests/ui/attributes/rustc_confusables_assoc_fn.rs: [missing] -> pass (J0)
  • [ui] tests/ui/iterators/rangefrom-overflow-2crates.rs: [missing] -> pass (J0)
  • completions::postfix::tests::closure_let_block: [missing] -> pass (J2)
  • completions::postfix::tests::let_before_semicolon: [missing] -> pass (J2)
  • completions::postfix::tests::snippet_dedent: [missing] -> pass (J2)
  • context::tests::expected_type_tuple_struct_pat: [missing] -> pass (J2)
  • handlers::add_braces::tests::suggest_add_braces_for_const_initializer: [missing] -> pass (J2)
  • handlers::add_braces::tests::suggest_add_braces_for_static_initializer: [missing] -> pass (J2)
  • handlers::add_label_to_loop::tests::add_label_to_for_expr: [missing] -> pass (J2)
  • handlers::add_label_to_loop::tests::add_label_to_while_expr: [missing] -> pass (J2)
  • handlers::add_label_to_loop::tests::do_not_add_label_if_outside_keyword: [missing] -> pass (J2)
  • handlers::add_lifetime_to_type::tests::add_lifetime_to_explicit_infer_lifetime: [missing] -> pass (J2)
  • handlers::add_lifetime_to_type::tests::add_lifetime_to_nested_types: [missing] -> pass (J2)
  • handlers::add_missing_match_arms::tests::add_missing_match_arms_end_of_last_empty_arm: [missing] -> pass (J2)
  • handlers::convert_named_struct_to_tuple_struct::tests::convert_constructor_expr_uses_self: [missing] -> pass (J2)
  • handlers::convert_named_struct_to_tuple_struct::tests::convert_pat_uses_self: [missing] -> pass (J2)
  • handlers::convert_tuple_struct_to_named_struct::tests::convert_expr_uses_self: [missing] -> pass (J2)
  • handlers::convert_tuple_struct_to_named_struct::tests::convert_pat_uses_self: [missing] -> ignore (FIXME overlap edits in nested uses self) (J2)
  • handlers::extract_variable::tests::extract_non_local_path_expr: [missing] -> pass (J2)
  • handlers::generate_trait_from_impl::tests::test_multi_fn_impl_not_suggest_trait_name: [missing] -> pass (J2)
  • handlers::generate_trait_from_impl::tests::test_remove_doc_comments: [missing] -> pass (J2)
  • handlers::inline_local_variable::tests::let_expr_works_on_local_usage: [missing] -> pass (J2)
  • handlers::inline_local_variable::tests::test_inline_let_expr: [missing] -> pass (J2)
  • handlers::inline_type_alias::test::inline_types_with_lifetime: [missing] -> pass (J2)
  • handlers::inline_type_alias::test::mixed_lifetime_and_type_args: [missing] -> pass (J2)
  • handlers::merge_imports::tests::merge_partial_selection_uses: [missing] -> pass (J2)
  • handlers::no_such_field::tests::test_add_field_from_usage_with_empty_struct: [missing] -> pass (J2)
  • handlers::non_exhaustive_let::tests::fix_return_in_closure: [missing] -> pass (J2)
  • handlers::non_exhaustive_let::tests::fix_return_in_fn: [missing] -> pass (J2)
  • handlers::non_exhaustive_let::tests::fix_return_in_incomplete_let: [missing] -> pass (J2)
  • handlers::non_exhaustive_let::tests::fix_return_in_loop: [missing] -> pass (J2)
  • handlers::non_exhaustive_let::tests::fix_return_in_macro_expanded: [missing] -> pass (J2)
  • handlers::non_exhaustive_let::tests::fix_return_try_in_fn: [missing] -> pass (J2)
  • handlers::unwrap_block::tests::simple_let_else: [missing] -> pass (J2)
  • handlers::unwrap_tuple::tests::unwrap_tuples_in_let_expr: [missing] -> pass (J2)
  • tests::rust_project_labeled_project_model: [missing] -> pass (J2)
  • tests::test_dedent: [missing] -> pass (J2)
  • tests::test_indent_of: [missing] -> pass (J2)
  • [assembly] tests/assembly-llvm/bpf_unaligned.rs: [missing] -> pass (J3)
  • [codegen] tests/codegen-llvm/bpf-allows-unaligned.rs: [missing] -> ignore (only executed when the architecture is bpf) (J4)
  • [assembly] tests/assembly-llvm/bpf_unaligned.rs: [missing] -> ignore (ignored when the LLVM version 21.1.2 is older than 22.0.0) (J7)

Stage 2

  • [assembly] tests/assembly-llvm/bpf_unaligned.rs: [missing] -> ignore (ignored when the LLVM version 21.1.2 is older than 22.0.0) (J1)
  • [ui] tests/ui/attributes/rustc_confusables_assoc_fn.rs: [missing] -> pass (J5)
  • [ui] tests/ui/iterators/rangefrom-overflow-2crates.rs: [missing] -> pass (J5)
  • [assembly] tests/assembly-llvm/bpf_unaligned.rs: [missing] -> pass (J6)
  • [pretty] tests/pretty/or-pattern-paren.rs: [missing] -> pass (J8)
  • [codegen] tests/codegen-llvm/bpf-allows-unaligned.rs: [missing] -> ignore (only executed when the architecture is bpf) (J9)

Additionally, 18 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 eb9d3caf0511a5fa9fa70251e2ac9fa33a9a4652 --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: 25m 10s -> 33m 27s (+32.9%)
  2. dist-apple-various: 1h 30m -> 1h 51m (+23.5%)
  3. x86_64-rust-for-linux: 44m 6s -> 53m 54s (+22.2%)
  4. x86_64-gnu-miri: 1h 20m -> 1h 35m (+18.6%)
  5. test-various: 1h 56m -> 2h 15m (+16.3%)
  6. x86_64-mingw-2: 2h 37m -> 3h 2m (+15.7%)
  7. x86_64-gnu-tools: 53m 2s -> 1h (+14.6%)
  8. i686-gnu-2: 1h 35m -> 1h 48m (+13.6%)
  9. dist-i586-gnu-i586-i686-musl: 1h 24m -> 1h 34m (+13.0%)
  10. pr-check-2: 38m 23s -> 43m 17s (+12.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
Copy Markdown
Collaborator

Finished benchmarking commit (eb9d3ca): 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 (primary 2.2%, 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)
2.2% [1.1%, 3.3%] 2
Regressions ❌
(secondary)
2.8% [2.8%, 2.8%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.2% [1.1%, 3.3%] 2

Cycles

Results (secondary -2.7%)

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.7% [-2.7%, -2.7%] 1
All ❌✅ (primary) - - 0

Binary size

Results (primary 0.0%, secondary 0.1%)

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

mean range count
Regressions ❌
(primary)
0.1% [0.0%, 0.1%] 51
Regressions ❌
(secondary)
0.1% [0.0%, 0.2%] 24
Improvements ✅
(primary)
-0.0% [-0.0%, -0.0%] 8
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.0% [-0.0%, 0.1%] 59

Bootstrap: 482.731s -> 484.336s (0.33%)
Artifact size: 396.84 MiB -> 396.95 MiB (0.03%)

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

Labels

A-attributes Area: Attributes (`#[…]`, `#![…]`) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) A-run-make Area: port run-make Makefiles to rmake.rs A-test-infra-minicore Area: `minicore` test auxiliary and `//@ add-core-stubs` 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. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.