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
Chayim Refael Friedman
b12a129347
Merge pull request #20701 from A4-Tacks/track-caller-assist-test
...
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
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
Shoyu Vanilla
3b4f5fbd73
minor: Get rid of unused deps chalk-solve and chalk-recursive
2025-09-19 22:35:46 +09:00
A4-Tacks
42bba767ef
Add #[track_caller] for check_assist_by_label
2025-09-19 13:39:45 +08: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
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
Shoyu Vanilla
c462f99914
fix: Fix indexmap with in-rust-tree
2025-09-19 03:04:14 +09:00
Laurențiu Nicola
f289a24d0a
Bump rustc crates again
2025-09-18 19:03:35 +03:00
Shoyu Vanilla
74dda38d54
chore: Update rustc deps
2025-09-18 23:02:42 +09:00
Chayim Refael Friedman
cd31e11f94
Merge pull request #20664 from ChayimFriedman2/coerce-ns
...
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
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
...
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
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
...
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
Add `rust-analyzer.semanticHighlighting.comments.enable`
2025-09-17 14:06:17 +00:00
Bart Jacobs
d106d41fbc
Add the rust-analyzer.semanticHighlighting.comments.enable configuration value
2025-09-17 15:46:23 +02:00
Chayim Refael Friedman
78bb458996
Merge pull request #20379 from skewb1k/fix/consistent-hover-doc-breaks
...
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
fix(hover): unify horizontal rule formatting to `---`
2025-09-17 02:02:48 +00:00
Shoyu Vanilla
0b76080c36
Fix "sync-from-ra" for rust-lang/rust
2025-09-17 03:22:52 +09:00
Lukas Wirth
57ad00b07f
Merge pull request #20612 from Veykril/veykril/push-vzuykrsxvrts
...
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
fix: Fix expand macro recursively not working correctly for nested macro calls
2025-09-16 07:51:08 +00:00
Lukas Wirth
0bbc55b367
Merge pull request #20402 from rust-lang/veykril/push-pursotqxutsx
...
Add more workaround hacks for incorrect startup diagnostics
2025-09-16 07:30:45 +00:00
Lukas Wirth
aecb756876
Merge pull request #20517 from Veykril/veykril/push-wrurmtqppzus
...
fix: Only compute unstable paths on nightly toolchains for IDE features
2025-09-16 07:28:47 +00:00
Lukas Wirth
015b9466c7
Add more workaround hacks for incorrect startup diagnostics
2025-09-16 09:18:03 +02:00
Lukas Wirth
8fcc577b73
Workaround lsp-types typo
2025-09-16 09:17:38 +02:00
Lukas Wirth
685f156fa6
fix: Only compute unstable paths on nightly toolchains for IDE features
2025-09-16 09:17:16 +02:00
Lukas Wirth
bd57ea0871
fix: Fix expand macro recursively not working correctly for nested macro calls
2025-09-16 09:16:42 +02:00
Shoyu Vanilla
33f7ffe4da
fix: More precise clause filtering for explicit_*_predicates_of
2025-09-16 01:44:00 +09:00
Chayim Refael Friedman
7d1860807e
Port a bunch of stuff from rustc and fix a bunch of type mismatches/diagnostics
...
This started from porting coercion, but ended with porting much more.
2025-09-15 18:56:17 +03:00
Chayim Refael Friedman
622b2675db
Merge pull request #20667 from ChayimFriedman2/ns-cleanup2
...
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
internal: Add Regression Test For The One And The Only Issue #5514
2025-09-15 06:02:57 +00:00
Chayim Refael Friedman
b9797aa325
Add Regression Test For The One And The Only Issue #5514
2025-09-15 08:50:41 +03:00
Laurențiu Nicola
6f9a6ba017
Merge pull request #20652 from ChayimFriedman2/cli-diags
...
internal: Improve `rust-analyzer diagnostics`
2025-09-15 05:42:46 +00:00
Shoyu Vanilla (Flint)
3a675445ac
Merge pull request #20665 from ChayimFriedman2/error-notable
...
fix: Don't mark unknown type as implementing every notable trait
2025-09-15 05:39:17 +00:00
Chayim Refael Friedman
40487c6a60
Add regression tests to some S-blocked-on-new-solver issues
...
That were fixed by the migration.
2025-09-15 08:25:17 +03:00
Chayim Refael Friedman
4dbb8b4c64
Don't mark unknown type as implementing every notable trait
...
Because the new solver, will return "yes" for them (which is a good thing).
2025-09-15 07:57:19 +03:00
Chayim Refael Friedman
27897e48dc
Improve rust-analyzer diagnostics
...
In my experience the `processing <module>` messages make it harder to search for the actual diagnostics, so remove them and instead print the filename only if there is a diagnostic.
Also allow choosing the minimum severity.
2025-09-14 23:22:57 +03:00
Chayim Refael Friedman
760d378e4c
Merge pull request #20654 from ShoyuVanilla/predicates
...
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
fix: Infinite loop while elaborting predicates
2025-09-14 11:20:04 +00:00
Shoyu Vanilla
26b8b794fb
fix: Infinite loop while elaborting predicates
2025-09-14 20:08:40 +09:00
Shoyu Vanilla (Flint)
5727ececcc
Merge pull request #20635 from iorizu/fix-double-flycheck
...
fix: Don't trigger two flychecks when saving files that are part of targets
2025-09-14 09:11:30 +00:00
A4-Tacks
d42c81e8d1
Fix extra semicolon before else in let-stmt
...
Example
---
```rust
fn main() {
let x = if true {
()
} $0 else {};
}
```
**Before this PR**:
```rust
fn main() {
let x = if true {
()
} else if $1 {
$0
}; else {};
}
```
**After this PR**:
```rust
fn main() {
let x = if true {
()
} else if $1 {
$0
} else {};
}
```
2025-09-12 20:56:59 +08:00
Ifeanyi Orizu
8497cba0e7
Minor refactoring
2025-09-11 10:38:34 -05:00
Shoyu Vanilla (Flint)
db0420c278
Merge pull request #20642 from ChayimFriedman2/wasm-safe
...
metrics / build_metrics (push) Has been cancelled
rustdoc / rustdoc (push) Has been cancelled
metrics / other_metrics (diesel-1.4.8) (push) Has been cancelled
metrics / other_metrics (hyper-0.14.18) (push) Has been cancelled
metrics / other_metrics (ripgrep-13.0.0) (push) Has been cancelled
metrics / other_metrics (self) (push) Has been cancelled
metrics / other_metrics (webrender-2022) (push) Has been cancelled
metrics / generate_final_metrics (push) Has been cancelled
fix: Make `#[target_feature]` always safe on WASM
2025-09-11 05:09:26 +00:00
Laurențiu Nicola
f9675f04ea
Merge pull request #20653 from A4-Tacks/gen-function-empty-gen-param
...
Fix empty generic param list for generate_function
2025-09-11 05:08:00 +00:00
A4-Tacks
d0b95bd67f
Fix empty generic param list for generate_function
...
Example
---
```rust
struct Foo<S>(S);
impl<S> Foo<S> {
fn foo(&self) {
self.bar()$0;
}
}
```
**Before this PR**:
```rust
struct Foo<S>(S);
impl<S> Foo<S> {
fn foo(&self) {
self.bar();
}
fn bar<>(&self) ${0:-> _} {
todo!()
}
}
```
**After this PR**:
```rust
struct Foo<S>(S);
impl<S> Foo<S> {
fn foo(&self) {
self.bar();
}
fn bar(&self) ${0:-> _} {
todo!()
}
}
```
2025-09-11 10:23:02 +08:00
Shoyu Vanilla (Flint)
d048a477dc
Merge pull request #20649 from ChayimFriedman2/cast-unknown
...
metrics / build_metrics (push) Has been cancelled
rustdoc / rustdoc (push) Has been cancelled
metrics / other_metrics (diesel-1.4.8) (push) Has been cancelled
metrics / other_metrics (hyper-0.14.18) (push) Has been cancelled
metrics / other_metrics (ripgrep-13.0.0) (push) Has been cancelled
metrics / other_metrics (self) (push) Has been cancelled
metrics / other_metrics (webrender-2022) (push) Has been cancelled
metrics / generate_final_metrics (push) Has been cancelled
fix: Always coerce in a cast, even when there are unknown types
2025-09-10 02:27:53 +00:00
Chayim Refael Friedman
577203afca
Always coerce in a cast, even when there are unknown types
...
This cause the relationships between inference vars to get recorded.
2025-09-10 04:57:10 +03:00
Shoyu Vanilla (Flint)
cd529a48f7
Merge pull request #20645 from ChayimFriedman2/update-rustc
...
internal: Upgrade rustc crates
2025-09-10 01:45:46 +00:00
Shoyu Vanilla (Flint)
8b2671e0c4
Merge pull request #20647 from ChayimFriedman2/ns-projections
...
fix: Fix normalization in the new solver
2025-09-10 01:32:49 +00:00
Chayim Refael Friedman
287a6e9482
Properly handle normalization
...
Previously normalization was broken, which caused a lot of fake errors.
This fix most type mismatches of the new solver, and it also reverts many test regressions.
The downside is that now `chalk_ir::TyKind::AssociatedType`/`chalk_ir::TyKind::Alias` cannot be trusted anymore with their roles, namely: `AssociatedType` is always fully normalized and `Alias` only if it can possibly be normalized further. That seems okay as the new solver does not have this distinction at all (due to it being a lazy normalizer), so this will only hold for the migration time. This does mean we have to change some APIs, notably `hir::Type::walk()` and `TyFingerprint`, to treat `Alias` the same as `AssociatedType`.
Another small thing this commit does is to isolate processing of user-written types (currently involving replacing error types and normalizing, but in the future validation will also be needed) to separate functions.
2025-09-10 03:32:06 +03:00