Conversation
```rust
fn f() { $0if let Some(x) = y { if x == 4 { 1 } } }
```
->
```rust
fn f() { if let Some(x) = y && x == 4 { 1 } }
```
**Input**:
```rust
fn f() {
i$0f x == 3 {
if y == 4 {
1
}
}
}
```
**Before this PR**:
```rust
fn f() {
if x == 3 && y == 4 {
1
}
}
```
**After this PR**:
```rust
fn f() {
if x == 3 && y == 4 {
1
}
}
```
Insert explicit method call reference and dereferences.
Example
---
```rust
struct Foo;
impl Foo { fn foo(&self) {} }
fn test() {
Foo$0.$0foo();
}
```
->
```rust
struct Foo;
impl Foo { fn foo(&self) {} }
fn test() {
(&Foo).foo();
}
```
Example
---
```rust
fn foo() {}
fn baz(_: impl FnOnce()) {}
fn bar() {
baz(fo$0);
}
```
**Before this PR**
```rust
fn foo() {}
fn baz(_: impl FnOnce()) {}
fn bar() {
baz(foo();$0);
}
```
**After this PR**
```rust
fn foo() {}
fn baz(_: impl FnOnce()) {}
fn bar() {
baz(foo()$0);
}
```
Using `this` instead of `self` in a closure is a common pattern
Example
---
```rust
struct Foo { field: i32 }
impl Foo {
fn foo(&mut self) {
let f: fn(&mut Self) = |this| { $0 };
f(self)
}
}
```
**Before this PR**
```text
fd self.field i32
me self.foo() fn(&mut self)
lc self &mut Foo
lc this &mut Foo
md core
sp Self Foo
st Foo Foo
tt Fn
tt FnMut
tt FnOnce
bt u32 u32
```
**After this PR**
```text
fd this.field i32
me this.foo() fn(&mut self)
lc self &mut Foo
lc this &mut Foo
md core
sp Self Foo
st Foo Foo
tt Fn
tt FnMut
tt FnOnce
bt u32 u32
```
Example
---
```rust
const _: fn() = || {
fn foo() $0{
45
}
}
```
**Before this PR**
Assist not applicable
**After this PR**
```rust
const _: fn() = || {
fn foo() -> i32 {
45
}
}
```
fix: consider let-else expr for return control type
Example
---
```rust
fn main() {
$0let x = true && false;
}
```
**Before this PR**
```rust
fn main() {
if let x = true {
}
}
```
**After this PR**
```rust
fn main() {
if let x = (true && false) {
}
}
```
fix: assign mutable for variables in pattern destructing assignments
…ip .` Summary: Test Plan: Reviewers: Subscribers: Tasks: Tags:
feat: Implementation of locals_used in HIR level
…tted-multiple-times Fix "Invariant violation: file emitted multiple times" when doing `scip .`
…s in the crate graph Which can happen when two workspaces are opened, by only considering impls from dependencies of this crate. I have no idea how to construct a test for this, but I tested it manually and it works.
fix: use `cmark_with_options` to write shortcuts links to the output
fix: Prefix json target file with workspace root for sysroot metadata
…et-with-iflet Fix invalid logic op for replace_let_with_if_let
…-in-closure Fix not applicable fn in closure for add_return_type
…ethod-resolution fix: Fix method resolution for incoherent impls when there are two sysroots in the crate graph
…sing-argument feat: show parameter hint for missing arguments
…list Fix complete unit return semicolon in arg-list
Example
---
```rust
fn main() {
let r = &2;
let _: fn() -> i32 = || *$0;
}
```
**Before this PR**
`ty: &'_ u32, name: x`
```rust
fn main() {
let r = &2;
let _: fn() -> i32 = || **r;
}
```
**After this PR**
`ty: &'_ &'_ u32, name: x`
```rust
fn main() {
let r = &2;
let _: fn() -> i32 = || *r;
}
```
Example
---
```rust
fn foo(r: &mut i32) -> &i32 { $0 }
```
**Before this PR**
`lc &r [type+local]`
This is a compilation error
```rust
fn foo(r: &mut i32) -> &i32 { &r }
```
**After this PR**
`lc r &mut i32 [type+local]`
```rust
fn foo(r: &mut i32) -> &i32 { r }
```
Fix expected type no strip deref
…cro-braces Fix guess renamed macro braces
Add guess braces doc `T![]` for `T_`
Example
---
```rust
fn main() {
{
let it = core::iter::repeat(92);
it.$0for_each(|param| match param {
(x, y) => println!("x: {}, y: {}", x, y),
});
}
}
```
**Before this PR**:
```rust
fn main() {
{
let it = core::iter::repeat(92);
for param in it {
match param {
(x, y) => println!("x: {}, y: {}", x, y),
}
}
}
}
```
**After this PR**:
```rust
fn main() {
{
let it = core::iter::repeat(92);
for param in it {
match param {
(x, y) => println!("x: {}, y: {}", x, y),
}
}
}
}
```
…-indent Fix indent for convert_iter_for_each_to_for
- Move `ide::goto_definition::find_loops` into `ide_db::syntax_helpers::node_ext::find_loops`
Add BreakExpr completion suggest
…ouwer remove `legacy_const_generic_args` cache putting this here to run perf
…n-suggestions, r=estebank
fix ICE when {{root}} appears in import suggestions
Fixes rust-lang#150103
When wrong nested imports like `use A::{::Fish}` were used, the internal {{root}} would appear in diagnostic suggestions, causing an ICE in `join_path_idents` which asserted that **{{root}} should only appear at the start of a path**.
r? ``@matthiaskrgr``
`rust-analyzer` subtree update Subtree update of `rust-analyzer` to rust-lang/rust-analyzer@31d2019. Created using https://github.com/rust-lang/josh-sync. r? `@ghost`
|
@bors r+ rollup=never p=5 |
|
☀️ Test successful - checks-actions |
|
📌 Perf builds for each rolled up PR:
previous master: e1212ea79b In the case of a perf regression, run the following command for each PR you suspect might be the cause: |
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 e1212ea (parent) -> 04813e4 (this PR) Test differencesShow 140 test diffsStage 0
Stage 1
Stage 2
(and 6 additional test diffs) Additionally, 34 doctest diffs were found. These are ignored, as they are noisy. Job group index
Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard 04813e4de86a5e024e71756ef092637aa862c984 --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
|
Finished benchmarking commit (04813e4): comparison URL. Overall result: ❌ regressions - no action needed@rustbot label: -perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary 2.5%, secondary 2.2%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary -2.7%, secondary -0.9%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary 0.1%, secondary 0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 481.652s -> 481.395s (-0.05%) |
|
^ Noise. |
Successful merges:
legacy_const_generic_argscache #150098 (removelegacy_const_generic_argscache)rust-analyzersubtree update #150267 (rust-analyzersubtree update)r? @ghost
@rustbot modify labels: rollup
Create a similar rollup