Commit graph

577 commits

Author SHA1 Message Date
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
Ryan Mehri
67a39886c3 feat: support navigation on primitives 2025-09-08 11:16:11 -04:00
Wilfred Hughes
bca5d59627 Remove support for register_attr
This was removed in rustc in 2022: https://github.com/rust-lang/rust/pull/101123

Closes #20525.
2025-09-08 15:56:56 +01:00
Shoyu Vanilla (Flint)
1d90205a98
Merge pull request #20527 from ChayimFriedman2/cache-next-solver
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
perf: Cache trait solving across queries in the same revision
2025-08-27 04:31:39 +00:00
Chayim Refael Friedman
870cb3329b
Merge pull request #20423 from ShoyuVanilla/import-2024
Some checks are pending
metrics / other_metrics (ripgrep-13.0.0) (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 (hyper-0.14.18) (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
Make import sorting order follow 2024 edition style
2025-08-25 19:19:31 +00:00
Chayim Refael Friedman
1c8a07cfd6 Cache trait solving across queries in the same revision
Caching trait solving can do a lot to speed. Unfortunately it also consume a huge amount of memory. Therefore, as part of the migration to the new solver Jack Huey disabled caching of trait solving (he made the query transparent).

The PR proposes a middle ground: do cache trait solving, but only for the same revision. This allows us to be safe because during a revision the inputs cannot change.

The result is hopefully much better performance to features that tend to do a bulk of trait solving, and also repeat the same query (e.g. inference then IDE features).

There is another limitation: results are only cached in the same thread, to remove the need for synchronization which will be expensive. More measurements are required to check whether it's better to use a synchronized global cache, or maybe stay with a thread-local cache but batch multiple feature requests (highlighting, inlay hints etc.) of the same file to the same thread.

Alongside the actual cache we store the revision, because we need to verify it (we can't eagerly clear caches when incrementing the revision), and also the address of the db to prevent multiple dbs from interleaving (this is mostly relevant in tests, although injected highlighting also uses a new db, therefore maybe it's better to move it to a separate thread).

This "games" analysis-stats to both be way faster and use way more memory; the former is because analysis-stats doesn't increment revisions, therefore all queries share the cache and hit ratio is way too good, the latter is because analysis-stats doesn't increment revisions and therefore the cache isn't cleared. Both are not representative of a typical IDE scenario.
2025-08-25 17:17:31 +03:00
Chayim Refael Friedman
243d158e88 Attach the DB in symbol queries 2025-08-21 07:14:55 +03:00
Shoyu Vanilla
15ac6a21dd fix: Make lang items query properly filter out overwritten/excluded sysroots 2025-08-17 22:28:04 +09:00
Deadbeef
82f174fbd9 Merge Trait and TraitAlias handling 2025-08-13 15:28:08 +08:00
Chayim Refael Friedman
b2a58b8c6e
Merge pull request #20432 from sgasho/fix/20215_implement_default_member_to_resolve_ident_pat
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 "Implement default members" to resolve IdentPat
2025-08-12 13:18:36 +00:00
sgasho
8ab683759e fix: Implement default member to resolve IdentPat 2025-08-12 21:53:50 +09:00
Shoyu Vanilla
635b536f11 Make import sorting order follow 2024 edition style 2025-08-12 00:01:46 +09:00
The rustc-josh-sync Cronjob Bot
966e694105 Merge ref '21a19c297d4f' from rust-lang/rust
Pull recent changes from https://github.com/rust-lang/rust via Josh.

Upstream ref: 21a19c297d4f5a03501d92ca251bd7a17073c08a
Filtered ref: 9a5c1fb930

This merge was created using https://github.com/rust-lang/josh-sync.
2025-08-11 04:30:34 +00:00
Stuart Cook
bc3327c665
Rollup merge of #144682 - nxsaken:strict_overflow_ops, r=Mark-Simulacrum
Stabilize `strict_overflow_ops`

Closes rust-lang/rust#118260
2025-08-07 20:49:47 +10:00
Hmikihiro
c57a42acf3 remvoe add_attr edit_in_place.rs because it use ted. 2025-08-04 21:52:49 +09:00
Nurzhan Sakén
e3d849467e Remove strict_overflow_ops lint 2025-08-04 04:13:10 +04:00
Chayim Refael Friedman
74ecb1e788 When renaming a parameter to self, change callers to use method call syntax 2025-08-02 21:39:22 +03:00
Lukas Wirth
8ce30264c8 cargo clippy --fix 2025-07-31 10:55:10 +02:00
Hayashi Mikihiro
46e86c6aa2 Migrate PathTransform to SyntaxEditor
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-07-26 13:26:39 +09:00
Hayashi Mikihiro
4866c4c2eb add Debug on AstSubst PathTransform.rs
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-07-26 13:26:11 +09:00