-
Couldn't load subscription status.
- Fork 13.9k
rust-analyzer subtree update
#148163
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
rust-analyzer subtree update
#148163
Conversation
Example
---
```rust
struct Foo;
impl Foo {
$0fn foo() {}
fn bar() {}$0
fn baz() {}
}
```
**Before this PR**:
```rust
struct Foo;
impl Foo {
mod modname {
pub(crate) fn foo() {}
pub(crate) fn bar() {}
}
fn baz() {}
}
```
**After this PR**:
```rust
struct Foo;
impl Foo {
fn baz() {}
}
mod modname {
use super::Foo;
impl Foo {
pub(crate) fn foo() {}
pub(crate) fn bar() {}
}
}
```
Flips operands of a range expression.
Example
---
```rust
fn main() {
let _ = 90..$02;
}
```
->
```rust
fn main() {
let _ = 2..90;
}
```
---
```rust
fn main() {
let _ = 90..$0;
}
```
->
```rust
fn main() {
let _ = ..90;
}
```
Example
---
```rust
struct S { field: (i32, i32) }
fn main() {
let S { $0field } = S { field: (2, 3) };
let v = field.0 + field.1;
}
```
**Before this PR**:
```rust
struct S { field: (i32, i32) }
fn main() {
let S { ($0_0, _1) } = S { field: (2, 3) };
let v = _0 + _1;
}
```
**After this PR**:
```rust
struct S { field: (i32, i32) }
fn main() {
let S { field: ($0_0, _1) } = S { field: (2, 3) };
let v = _0 + _1;
}
```
Example
---
```rust
fn main() {
if$0 let Ok(x) = Err(92)
&& let Ok(y) = Ok(37)
&& x < 30
&& let Some(y) = Some(8)
{
foo(x, y);
}
}
```
**Before this PR**:
```rust
fn main() {
let Ok(x) = Err(92) else { return };
if !(let Ok(y) = Ok(37) && x < 30) {
return;
}
let Some(y) = Some(8) else { return };
foo(x, y);
}
```
**After this PR**:
```rust
fn main() {
let Ok(x) = Err(92) else { return };
let Ok(y) = Ok(37) else { return };
if x >= 30 {
return;
}
let Some(y) = Some(8) else { return };
foo(x, y);
}
```
Example
---
```rust
fn f() {
if cond {
3 * 2
} e$0lse {
1
}
}
```
->
```rust
fn f() {
if !cond {
1
} else {
3 * 2
}
}
```
The bulk of the work is trait solving and cached in the trait solver's cache, and this will save memory.
minor: Fix creating `rust-analyzer/rust-analyzer` under target-dir
Fix compile error in `crates/cfg` tests due to `tt` feature
- And fix indent
Example
---
```rust
fn foo() {
{
match n {
Some(n) $0=> foo(
29,
30,
),
_ => ()
};
}
}
```
**Before this PR**:
```rust
fn main() {
{
match n {
Some(n) => {
foo(
29,
30,
)
},
_ => ()
};
}
}
```
**After this PR**:
```rust
fn foo() {
{
match n {
Some(n) => {
foo(
29,
30,
)
},
_ => ()
};
}
}
```
- And fix indentations
Example
---
```rust
fn main() {
match None$0 {
None => {
foo(
"foo",
"bar",
);
}
}
}
```
**Before this PR**:
```rust
fn main() {
match None {
None => {
foo(
"foo",
"bar",
);
}
Some(_) => todo!(),
}
}
```
**After this PR**:
```rust
fn main() {
match None {
None => {
foo(
"foo",
"bar",
);
}
Some(${1:_}) => ${2:todo!()},$0
}
}
```
…iant-to-interner Use FileId::MAX for id assertion in PathInterner::intern
But add a flag to do so.
…anic Use tracing error when received compiler message for unknown package
Example
---
```rust
fn f() {
if $0foo.bar() {}
}
```
**Before this PR**
"let" not in completion list
**After this PR**
```rust
fn f() {
if let $1 = $0foo.bar() {}
}
```
…to-guarded Fix untyped syntax tree ans casts for convert_to_guarded_return
Fix not complete `let` before expr in condition
…else Fix let-expr in lhs for convert_to_guarded_return
Add ide-assist: flip_range_expr
…hand Fix shorthand field pat for destructure_tuple_binding
Fix extract multiple item in impl for extract_module
Add ide-assist: remove else branches
Example
---
```rust
fn main() {
let x = Some(1);
let cond = true;
if cond && x.is_som$0e() {}
}
```
**Before this PR**
Assist not applicable
**After this PR**
```rust
fn main() {
let x = Some(1);
let cond = true;
if cond && let Some(${0:x1}) = x {}
}
```
Add an Extension Config API
…method-with-if-let Fix not applicable on let-chain for replace_is_method_with_if_let_method
Add regression tests for some fixed `A-ty` issues
|
rust-analyzer is developed in its own repository. If possible, consider making this change to rust-lang/rust-analyzer instead. cc @rust-lang/rust-analyzer |
|
@bors r+ p=1 subtree sync |
|
☀️ Test successful - checks-actions |
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 23fced0 (parent) -> 34a8c73 (this PR) Test differencesShow 2 test diffs2 doctest diffs were found. These are ignored, as they are noisy. Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard 34a8c7368c84fc699fc83a8851a02f93fd655931 --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 |
Subtree update of
rust-analyzerto rust-lang/rust-analyzer@049767e.Created using https://github.com/rust-lang/josh-sync.
r? @ghost