-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
Rollup of 4 pull requests #150277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
JonathanBrouwer
wants to merge
98
commits into
rust-lang:main
Choose a base branch
from
JonathanBrouwer:rollup-gvmdw36
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Rollup of 4 pull requests #150277
+7,974
−4,366
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```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
internal: Improve recursive mbe parsing behavior
Call out feature freeze on IDE assists
Add ide-assist: add_explicit_method_call_deref
Add LetStmt doc for convert_to_guarded_return
…point Remove conflicting advice
Fix nested if-let for merge_nested_if
Fix indent for merge_nested_if
…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`
Contributor
Author
|
@bors r+ rollup=never p=5 |
Collaborator
Collaborator
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
rollup
A PR which is a rollup
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
T-compiler
Relevant to the compiler 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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