35972 Commits

Author SHA1 Message Date
Chayim Refael Friedman
f41f762a80
Merge pull request #20718 from ChayimFriedman2/inlay-max-len-docs
minor: Clarify `rust-analyzer.inlayHints.maxLength` is not a hard guarantee
2025-09-22 01:27:15 +00:00
Chayim Refael Friedman
129d9f7af6 Clarify rust-analyzer.inlayHints.maxLength is not a hard guarantee 2025-09-22 04:16:50 +03:00
Shoyu Vanilla (Flint)
e7d7cb415a
Merge pull request #20714 from A4-Tacks/rm-dbg-trailing-comma
Fix not applicable on trailing comma for remove_dbg
2025-09-21 06:48:17 +00:00
A4-Tacks
168ca55a99
Fix not applicable on trailing comma for remove_dbg
`remove_dbg` not applicable for whitespaces after trailing comma

Example
---
```rust
fn foo() {
    dbg!(
        bar(),
    );
}
```

**Before this PR**:

Assist not applicable

**After this PR**:

```rust
fn foo() {
    bar();
}
```
2025-09-21 11:05:10 +08:00
Shoyu Vanilla (Flint)
187917fa5d
Merge pull request #20706 from A4-Tacks/stdx-replace-inplace
Fix to implements in-place stdx::replace
2025-09-20 13:32:39 +00:00
A4-Tacks
29de96c4e0
Add some test for stdx::replace 2025-09-20 21:15:12 +08:00
Shoyu Vanilla (Flint)
a003d4d127
Merge pull request #20661 from A4-Tacks/suggest-if-body
Fix IfExpr branches suggests
2025-09-20 13:08:01 +00:00
A4-Tacks
48dc150f31
Fix to implements in-place stdx::replace 2025-09-20 20:58:44 +08:00
A4-Tacks
07f33e2b81
Fix IfExpr then branch suggest
- And add logic operation suggest

Example
---
In the old implementation, it always suggested conditions,
this is a lot of noise, e.g `contract_checks()~(use std::intrinsics::contract_checks) const fn() -> bool`

```rust
fn foo() {
    if true {
        c$0
    }
}
```
2025-09-20 20:56:27 +08:00
Shoyu Vanilla (Flint)
3705f71df9
Merge pull request #20710 from A4-Tacks/unused-var-shorthand
Fix unused_variables fixes shorthand record field
2025-09-20 12:54:34 +00:00
Shoyu Vanilla (Flint)
6d5bfaee6a
Merge pull request #20709 from A4-Tacks/destruct-panic-on-not-add-deref-and-paren
Fix panic `!self.data().mutable` for destructure_struct_binding
2025-09-20 12:41:21 +00:00
Shoyu Vanilla (Flint)
da47c3da45
Merge pull request #20686 from A4-Tacks/gen-default-not-apply-selected
Fix selected applicable generate_default_from_enum_variant
2025-09-20 12:40:50 +00:00
David Barsky
a196eba3eb
Merge pull request #20689 from ShoyuVanilla/accurate-flycheck
fix: Make flycheck clearing dependency-aware
2025-09-20 12:33:39 +00:00
A4-Tacks
d6c66dff1d
Fix selected multi variants applicable generate_default_from_enum_variant 2025-09-20 20:29:02 +08:00
Shoyu Vanilla (Flint)
259a01d73d
Merge pull request #20688 from A4-Tacks/fix-applicable-after-l-curly-replace-is-method-with-if-let
Fix applicable after l_curly for replace_is_method_with_if_let_method
2025-09-20 12:06:18 +00:00
Shoyu Vanilla (Flint)
84bb4051bf
Merge pull request #20700 from A4-Tacks/extract-var-let-expr
Fix extract_variable on LetExpr
2025-09-20 11:59:20 +00:00
Shoyu Vanilla (Flint)
a943034d68
Merge pull request #20702 from A4-Tacks/else-not-before-else
Fix `else` completion before else keyword
2025-09-20 11:57:07 +00:00
Shoyu Vanilla (Flint)
81ea457fc5
Merge pull request #20708 from A4-Tacks/destruct-ref-mut-panics
Fix panics on `Foo{mut x}` for destructure_struct_binding
2025-09-20 11:54:47 +00:00
A4-Tacks
a41ca500b0
Fix unused_variables fixes shorthand record field
Example
---

```rust
struct S { field : u32 }
fn main() {
    let s = S { field : 2 };
    let S { $0field } = s
}
```

**Before this PR**:

```rust
struct S { field : u32 }
fn main() {
    let s = S { field : 2 };
    let S { _field } = s
}
```

**After this PR**:

```rust
struct S { field : u32 }
fn main() {
    let s = S { field : 2 };
    let S { field: _field } = s
}
```
2025-09-20 18:25:28 +08:00
A4-Tacks
f34e9ca8d3
Fix panic !self.data().mutable for destructure_struct_binding
When the reference type does not require adding a dereference or parentheses, it will panic

Example
---

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

fn main() {
    let $0foo = &Foo { bar: 1, baz: 2 };
    let _ = &foo.bar;
}
```

**Before this PR**:

Panic:
```
assertion failed: !self.data().mutable
```

**After this PR**:

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

fn main() {
    let Foo { bar, baz } = &Foo { bar: 1, baz: 2 };
    let _ = bar;
}
```
2025-09-20 17:52:01 +08:00
A4-Tacks
d4731ad9e2
Fix panics on Foo{mut x} for destructure_struct_binding
Example
---
```rust
struct Foo { x: () }
struct Bar { foo: Foo }
fn f(Bar { mut $0foo }: Bar) {}
```

**Before this PR**:

Panic `Option::unwrap`

**After this PR**:

```rust
struct Foo { x: () }
struct Bar { foo: Foo }
fn f(Bar { foo: Foo { mut x } }: Bar) {}
```
2025-09-20 16:14:51 +08:00
Laurențiu Nicola
0c62c01aae
Merge pull request #20707 from lnicola/bump-rustc
minor: Bump rustc crates once more
2025-09-20 06:50:11 +00:00
Laurențiu Nicola
4599670308 Bump rustc crates once more 2025-09-20 09:38:53 +03:00
Shoyu Vanilla
de3ad58b73 fix: Make flycheck clearing dependency-aware 2025-09-20 01:35:35 +09:00
Chayim Refael Friedman
b12a129347
Merge pull request #20701 from A4-Tacks/track-caller-assist-test
Add `#[track_caller]` for check_assist_by_label
2025-09-19 15:07:17 +00:00
Shoyu Vanilla (Flint)
2c6f0fc0df
Merge pull request #20697 from Oblarg/fix-negative-const-generic-literals
fix negative const generic integer literals
2025-09-19 14:13:54 +00:00
Oblarg
30031b84a8 address review feedback 2025-09-19 10:03:14 -04:00
Laurențiu Nicola
adf6c0d976
Merge pull request #20703 from ShoyuVanilla/remove-chalk-solve
minor: Get rid of unused deps `chalk-solve` and `chalk-recursive`
2025-09-19 13:47:35 +00:00
Shoyu Vanilla
3b4f5fbd73 minor: Get rid of unused deps chalk-solve and chalk-recursive 2025-09-19 22:35:46 +09:00
A4-Tacks
c976f9900d
Fix else completion before else keyword
Example
---
```rust
fn foo() {
    let x = if true {
        1
    } el$0 else {
        2
    };
}
```

**Before this PR**:

```text
else~    k [LS]
else if~ k [LS]
```

**After this PR**:

```text
else if~ k [LS]
```
2025-09-19 19:59:47 +08:00
A4-Tacks
42bba767ef
Add #[track_caller] for check_assist_by_label 2025-09-19 13:39:45 +08:00
A4-Tacks
3610cb12f7
Fix extract_variable on LetExpr
Example
---
```rust
fn main() {
    if $0let$0 Some(x) = Some(2+2) {}
}
```

**Before this PR**:

```rust
fn main() {
    let $0var_name = let Some(x) = Some(2+2);
    if var_name {}
}
```

**After this PR**:

```rust
fn main() {
    let $0var_name = Some(2+2);
    if let Some(x) = var_name {}
}
```
2025-09-19 13:35:34 +08:00
Laurențiu Nicola
50bb3c5d82
Merge pull request #20699 from lnicola/ena-fingerprint
minor: Set `WithCachedTypeInfo::stable_hash` when in-tree
2025-09-19 05:20:01 +00:00
Laurențiu Nicola
5a643b8158 Set WithCachedTypeInfo::stable_hash when in-tree 2025-09-19 08:08:23 +03:00
Oblarg
d0bdedde0e fix negative const generic integer literals 2025-09-18 18:55:13 -04:00
Shoyu Vanilla (Flint)
958a8d06e3
Merge pull request #20695 from ShoyuVanilla/fix-another-in-tree
fix: Fix one more thing in `in-rust-tree`
2025-09-18 19:34:53 +00:00
Shoyu Vanilla
a04f5185b1 fix: Fix one more thing in in-rust-tree 2025-09-19 04:20:24 +09:00
Laurențiu Nicola
e6c3152214
Merge pull request #20694 from ShoyuVanilla/bump-rustc
minor: Yet another rustc crates bump
2025-09-18 18:38:03 +00:00
Shoyu Vanilla
7dfb1c463e minor: Yet another rustc crates bump 2025-09-19 03:26:03 +09:00
Laurențiu Nicola
85b6332d46
Merge pull request #20693 from ShoyuVanilla/fix-indexmap-in-tree
fix: Fix `indexmap` with `in-rust-tree`
2025-09-18 18:16:41 +00:00
Shoyu Vanilla
c462f99914 fix: Fix indexmap with in-rust-tree 2025-09-19 03:04:14 +09:00
Shoyu Vanilla (Flint)
15070dcc25
Merge pull request #20691 from lnicola/bump-rustc-again
minor: Bump rustc crates again
2025-09-18 16:14:50 +00:00
Laurențiu Nicola
f289a24d0a Bump rustc crates again 2025-09-18 19:03:35 +03:00
Laurențiu Nicola
28849aa3b3
Merge pull request #20690 from ShoyuVanilla/update-rustc
minor: Update rustc deps
2025-09-18 14:14:40 +00:00
Shoyu Vanilla
74dda38d54 chore: Update rustc deps 2025-09-18 23:02:42 +09:00
A4-Tacks
d3748517c9
Fix applicable after l_curly for replace_is_method_with_if_let_method 2025-09-18 20:00:31 +08:00
Chayim Refael Friedman
cd31e11f94
Merge pull request #20664 from ChayimFriedman2/coerce-ns
fix: Port a bunch of stuff from rustc and fix a bunch of type mismatches/diagnostics
2025-09-18 00:19:30 +00:00
Shoyu Vanilla (Flint)
2268a56350
Merge pull request #20682 from A4-Tacks/fix-change-vis-applicable-on-variant
Fix applicable on variant field for change_visibility
2025-09-17 17:00:31 +00:00
A4-Tacks
5b5c50eec8
Fix applicable on variant field for change_visibility
Enum variant fields do not allow visibility

Example
---
```rust
enum Foo {
    Variant($0String),
}
```

**Before this PR**:

```rust
enum Foo {
    Variant(pub(crate) String),
}
```

**After this PR**:

Assist not applicable
2025-09-17 22:57:25 +08:00
Chayim Refael Friedman
5b68439f13
Merge pull request #20583 from btj/comments-enable
Add `rust-analyzer.semanticHighlighting.comments.enable`
2025-09-17 14:06:17 +00:00