Commit graph

575 commits

Author SHA1 Message Date
A4-Tacks
ac01f880d7
Add BreakExpr completion suggest
- Move `ide::goto_definition::find_loops`
  into `ide_db::syntax_helpers::node_ext::find_loops`
2025-12-22 20:13:56 +08:00
A4-Tacks
847317ccba
Add default varname for TryEnum postfix completion
Example
---
```rust
fn main() {
    let bar = Some(true);
    bar.i$0
}
```

**Before this PR**

```rust
fn main() {
    let bar = Some(true);
    if let Some($1) = bar {
        $0
    }
}
```

**After this PR**

```rust
fn main() {
    let bar = Some(true);
    if let Some(${1:bar}) = bar {
        $0
    }
}
```
2025-12-21 13:55:21 +08:00
Chayim Refael Friedman
3f37e42aeb
Merge pull request #21262 from dfireBird/hir-locals-used
feat: Implementation of locals_used in HIR level
2025-12-15 14:26:41 +00:00
dfireBird
21713002ff
fix: consider path used in pattern destructing assignments
fix: assign mutable for variables in pattern destructing assignments
2025-12-15 17:28:05 +05:30
The rustc-josh-sync Cronjob Bot
2d06e40dd0 Merge ref '0208ee09be46' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: 0208ee09be465f69005a7a12c28d5eccac7d5f34
Filtered ref: 69b2702db7
Upstream diff: dfe1b8c97b...0208ee09be

This merge was created using https://github.com/rust-lang/josh-sync.
2025-12-15 04:30:45 +00:00
Lukas Wirth
0da7839f48 internal: Give FileSymbol it's 'db lifetime 2025-12-14 10:54:13 +01:00
Jieyou Xu
acb575c6ab
rust-analyzer: prep crates for testing against in-tree rustc_private 2025-12-11 20:22:49 +08:00
Lukas Wirth
30550d917b Make ModuleId a tracked struct
optimize some stuff

Optimize `pub(crate)` visibility resolution

Optimize private visibility resolution
2025-12-07 09:31:19 +01:00
The rustc-josh-sync Cronjob Bot
4f45c093e1 Merge ref 'dfe1b8c97bcd' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: dfe1b8c97bcde283102f706d5dcdc3649e5e12e3
Filtered ref: d3d1f3831e
Upstream diff: 1be6b13be7...dfe1b8c97b

This merge was created using https://github.com/rust-lang/josh-sync.
2025-12-01 04:34:35 +00:00
Chayim Refael Friedman
f0e372c3b6 Rewrite attribute handling
Basically, we switch to expanding cfg_attr in AST form, filter irrelevant attributes from the item tree, and move hir-def attributes (non-item-tree) to be flag-based.

The main motivation is memory usage, although this also simplifies the code, and fixes some bugs around handling of `cfg_attr`s.
2025-11-29 18:52:18 +02:00
Stuart Cook
a27baea97d
Rollup merge of #149087 - nxsaken:unchecked_neg_shifts_stabilize, r=Amanieu
Stabilize `unchecked_neg` and `unchecked_shifts`

Features: `unchecked_neg`, `unchecked_shifts`
Tracking issue: rust-lang/rust#85122

r? `@Amanieu`
2025-11-28 15:30:43 +11:00
Laurențiu Nicola
45ae0abfed
Merge pull request #21126 from A4-Tacks/arglist-nr-error-comma
Some checks are pending
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: fix parameter info with missing arguments
2025-11-25 12:50:22 +00:00
A4-Tacks
1d40867fc8
Fix invalid completion arg nr
Example
---
```rust
fn foo() { bar(, $0); }
fn bar(x: u32, y: i32) {}
```

**Before this PR**

```text
ty: u32, name: x
```

**After this PR**

```text
ty: i32, name: y
```
2025-11-25 16:13:59 +08:00
Zalathar
fe1469ebd1 Basic support for declarative attribute/derive macros 2025-11-24 21:50:56 +11:00
Chayim Refael Friedman
2cba0b6be7
Merge pull request #21074 from Aditya-PS-05/fix/param-macro-names-21070
Some checks are pending
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: show no error when parameters match macro names
2025-11-22 19:56:41 +00:00
Aditya-PS-05
d2ce37aef4 fix: don't qualify macro names in pattern bindings 2025-11-22 23:13:02 +05:30
Lukas Wirth
f1804ae339 perf: Prime trait impls in cache priming 2025-11-21 15:48:42 +01:00
Aditya-PS-05
b6c3409ded fix: show no error when parameters match macro names 2025-11-20 18:19:18 +05:30
nxsaken
d5839ff14a Stabilize unchecked_neg and unchecked_shifts 2025-11-19 13:19:22 +04:00
Laurențiu Nicola
213a824b4d Merge ref '6159a44067eb' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: 6159a44067ebce42b38f062cc7df267a1348e092
Filtered ref: 6ab1e12842
Upstream diff: c5dabe8cf7...6159a44067

This merge was created using https://github.com/rust-lang/josh-sync.
2025-11-19 08:27:10 +02:00
Chayim Refael Friedman
e8e02d5515
Merge pull request #20974 from ChayimFriedman2/ns4
fix: Rewrite method resolution to follow rustc more closely
2025-11-18 23:20:04 +00:00
Matthias Krüger
dba9069adc
Rollup merge of #149057 - lnicola:sync-from-ra, r=lnicola
`rust-analyzer` subtree update

Subtree update of `rust-analyzer` to afcfe141ae.

Created using https://github.com/rust-lang/josh-sync.

r? `@ghost`
2025-11-18 16:52:12 +01:00
Lukas Wirth
d7aeed0b87
Merge pull request #21046 from Veykril/push-xluyprrqpzxz
perf: Improve start up time
2025-11-18 12:16:04 +00:00
Martin Kröning
1189b49a6f
doc: fix strict_provenance_lints tracking issue link 2025-11-17 17:23:55 +01:00
Lukas Wirth
5107faaae7 Prime lang item queries 2025-11-17 15:14:00 +01:00
Lukas Wirth
18851eb06b Merge pull request #20997 from Veykril/push-zsuorxrkpupr
perf: Only populate public items in dependency symbol index
2025-11-15 09:17:33 +02:00
Lukas Wirth
827be28900 Merge pull request #20995 from Veykril/push-kysxxnruzslp
internal: Move `SymbolsDatabase` over to new salsa style
2025-11-15 09:17:33 +02:00
Lukas Wirth
c1c6682e8b Merge pull request #20994 from Veykril/push-npvyklkuxnlr
perf: Reduce memory usage of symbol index
2025-11-15 09:17:33 +02:00
Chayim Refael Friedman
50384460c6 Rewrite method resolution to follow rustc more closely
It cannot be exactly the same, because we have needs rustc doesn't have (namely, accurate enumeration of all methods, not just with a specific name, for completions etc., while rustc also needs a best-effort implementation for diagnostics) but it is closer than the previous impl.

In addition we rewrite the closely related handling of operator inference and impl collection.

This in turn necessitate changing some other parts of inference in order to retain behavior. As a result, the behavior more closely matches rustc and is also more correct.

This fixes 2 type mismatches on self (1 remains) and 4 diagnostics (1 remains), plus some unknown types.
2025-11-05 18:43:36 +02:00
The rustc-josh-sync Cronjob Bot
ae9f97c299 Merge ref 'c5dabe8cf798' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: c5dabe8cf798123087d094f06417f5a767ca73e8
Filtered ref: 3214048a4d
Upstream diff: fb24b04b09...c5dabe8cf7

This merge was created using https://github.com/rust-lang/josh-sync.
2025-11-03 04:20:09 +00:00
Jakub Beránek
f0ff861dca
Generalize branch references to HEAD 2025-11-02 11:15:55 +01:00
Chayim Refael Friedman
44227800c6 Fix handling of blocks modules that are not the root module 2025-10-28 12:57:26 +02:00
Chayim Refael Friedman
4c709bad14 Consider all matches for flyimport even when searched with a qualifier 2025-10-27 19:26:27 +02:00
Chayim Refael Friedman
7a7ab993bb
Revert "internal: Rewrite attribute handling" 2025-10-22 19:19:13 +03:00
Chayim Refael Friedman
455ca02f17 Rewrite attribute handling
Basically, we switch to expanding cfg_attr in AST form, filter irrelevant attributes from the item tree, and move hir-def attributes (non-item-tree) to be flag-based.

The main motivation is memory usage, although this also simplifies the code, and fixes some bugs around handling of `cfg_attr`s.
2025-10-22 11:47:01 +03:00
Chayim Refael Friedman
81e621af0b Improve fixture support
Support more features beside highlighting, and support items from minicore.
2025-10-16 22:06:16 +03:00
Laurențiu Nicola
a01c123c75 Merge ref 'fb24b04b096a' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: fb24b04b096a980bffd80154f6aba22fd07cb3d9
Filtered ref: 8d328b994c
Upstream diff: 3369e82c6b...fb24b04b09

This merge was created using https://github.com/rust-lang/josh-sync.
2025-10-14 13:31:56 +03:00
Camille GILLOT
1b8d475ece Silence warning in r-a. 2025-10-11 20:50:21 +00:00
Shoyu Vanilla (Flint)
87ccc2b7c9
Merge pull request #20801 from ChayimFriedman2/fix-insert-use
minor: Small fixes for import insertion
2025-10-10 08:28:42 +00:00
Chayim Refael Friedman
9d70d32163 Fix merging of import granularity setting with the granularity we infer
Previously it was wrong for some combinations.
2025-10-05 17:47:11 +03:00
Chayim Refael Friedman
10db7ac7a4 Deprecate preserve import granularity option
It didn't do anything (behaved like `item`), as with `enforceGranularity = false` (which is the default), the style of the current file is always preferred, regardless of the setting.

We could make it fail when the setting is `preserve` and the current file's style could not be detected, but that makes little sense.

It is a bit weird that the default is `crate` but `preserve` falls back to `item`, however that was the previous behavior.
2025-10-05 15:19:52 +03:00
Chayim Refael Friedman
c6ef51e550 Switch to home-made db attaching infrastructure
Instead of using Salsa's, as we can no longer can a `dyn HirDatabase` from the `dyn salsa::Database` Salsa provides.
2025-10-05 09:55:50 +03:00
itsjunetime
3a6e472975
Fix two small things clippy was complaining about 2025-10-01 22:41:01 -05:00
Shoyu Vanilla (Flint)
a96d92e9e9
Merge pull request #20736 from A4-Tacks/fix-invert-if-let-chain
Fix applicable on if-let-chain for invert_if
2025-09-26 05:36:52 +00:00
A4-Tacks
39ef6c28eb
Fix applicable on if-let-chain for invert_if
Example
---
```rust
fn f() { i$0f x && let Some(_) = Some(1) { 1 } else { 0 } }
```

**Before this PR**:

```rust
fn f() { if !(x && let Some(_) = Some(1)) { 0 } else { 1 } }
```

**After this PR**:

Assist not applicable
2025-09-24 14:36:09 +08:00
Jack Huey
73a401301d Remove lower::value_ty in favor of lower_nextsolver::value_ty 2025-09-23 03:58:51 -04: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
685f156fa6 fix: Only compute unstable paths on nightly toolchains for IDE features 2025-09-16 09:17:16 +02:00
Chayim Refael Friedman
9edc9cbe5d
Merge pull request #20632 from rmehri01/navigation-on-prims
Some checks are pending
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
feat: support navigation on primitives
2025-09-08 20:12:04 +00:00
Ryan Mehri
535147d57f impl TryToNav for BuiltinType instead 2025-09-08 14:23:52 -04:00