Commit graph

544 commits

Author SHA1 Message Date
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 / 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 (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
Chayim Refael Friedman
7723b21c3f Fix search of raw labels and lifetimes
It used to search for `'foo` which won't find `'r#foo`, now we search for `foo` instead.
2025-07-20 01:20:09 +03:00
Laurențiu Nicola
f373437c22 Merge from rust-lang/rust 2025-07-15 17:27:46 +03:00
Deadbeef
cc08f71756 update issue number for const_trait_impl 2025-07-13 23:55:06 +08:00
David Barsky
5bae4f5c81
Merge pull request #20185 from ChayimFriedman2/variant-symbols
feat: Include enum variants in world symbols
2025-07-07 15:15:27 +00:00
Chayim Refael Friedman
b34e5b7fe4 Include enum variants in world symbols
I opted to not include enum variant imports, only under the enum, and to not gate this behind a setting.
2025-07-06 14:52:10 +03:00
Lukas Wirth
2691c11104
Merge pull request #20132 from A4-Tacks/asmut-borrow-minicore
Add AsMut, Borrow and BorrowMut to minicore and famous_defs
2025-07-06 08:01:54 +00:00
Lukas Wirth
2480a42ff4 fix: Improve diagnostic ranges for macro_calls!
We used to point to the entire macro call including its token tree if we couldn't upmap the diagnostic to the input
This generally makes things very noisy as the entire macro call will turn red on errors.
Instead, we now macro the path and `!` (bang) token as the error source range which is a lot nicer on the eyes.
2025-07-03 14:12:27 +02:00
Lukas Wirth
8029c731ed Bump salsa 2025-07-03 10:05:16 +02:00
A4-Tacks
cb000ad313
Add AsMut Borrow BorrowMut to minicore and famous_defs 2025-07-01 15:26:45 +08:00
Chayim Refael Friedman
4db8341ddb Prettify AST in PathTransform if it's coming from a macro 2025-06-26 10:03:44 +03:00
Chayim Refael Friedman
de312d0c71 Don't run doctests 2025-06-23 00:50:22 +03:00
Lukas Wirth
3bf8a77d13
Merge pull request #20023 from Veykril/push-vkqlnyttnqzl
Improve completions in if / while expression conditions
2025-06-17 12:01:43 +00:00
Lukas Wirth
4331688e3d Improve completions in if / while expression conditions 2025-06-17 13:50:58 +02:00
Lukas Wirth
03f1003637 chore: Start infesting ide crates with 'db lifetime 2025-06-17 10:42:38 +02:00
Lucas Holten
dc85e3ee35 Add config option to exclude imports from symbol search 2025-06-15 02:41:35 +02:00
Lukas Wirth
23712aea06 cargo upgrade 2025-06-13 10:08:20 +02:00
Laurențiu Nicola
273514a9fb Merge from rust-lang/rust 2025-06-09 15:44:40 +03:00
Paolo Barbolini
69f077653a Stabilize const_eq_ignore_ascii_case 2025-06-05 07:09:16 +00:00
Lukas Wirth
96c4455114 fix: Fix edition handling for names in rename logic 2025-06-02 15:27:13 +02:00
Lukas Wirth
42e8e4ac4e Enhance renaming to include identifiers that are generated from the original symbol
Co-authored-by: Jake Goulding <jake.goulding@integer32.com>
2025-06-02 15:26:21 +02:00
Lukas Wirth
38bf4b1fe1 internal: Restructure some semantics APIs for virtual macro files 2025-05-30 22:03:04 +02:00
Lukas Wirth
1f0052a496 fix: Fix import insertion not being fully cfg aware 2025-05-29 14:55:09 +02:00
Lukas Wirth
de4b7b642b
Merge pull request #19864 from ChayimFriedman2/is-in-macro
fix: Properly implement `might_be_inside_macro_call()` using semantic information instead of syntactical hacks
2025-05-26 05:21:01 +00:00
Chayim Refael Friedman
87529e8631 Properly implement might_be_inside_macro_call() using semantic information instead of syntactical hacks
And rename it to `is_inside_macro_call()` accordingly.
2025-05-25 20:15:58 +03:00
Lukas Wirth
cbff4ae151 Bump salsa 2025-05-23 12:58:00 +02:00
Laurențiu Nicola
9e86544698 Merge from rust-lang/rust 2025-05-20 10:01:00 +03:00
Dietrich Daroch
3faf03f6b4 Split duration_constructors to get non-controversial bits out faster. 2025-05-09 22:52:39 -04:00
Lukas Wirth
8b624868e4
Merge pull request #19507 from Hmikihiro/fix_module_doc_links
fix: resolve doc path from parent module if outer comments exist on module
2025-05-08 16:34:35 +00:00
Hayashi Mikihiro
778322eb31 check module path inner or outer
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-05-07 00:36:17 +09:00
Chayim Refael Friedman
f23af9291c Notify the user that we're collecting symbols
It could be confusing if they see "Indexing n/n" but cache priming does not finish.
2025-05-06 10:29:53 +03:00
Chayim Refael Friedman
1c7a94f37d Add a --num-threads to the prime-caches CLI command
And make it parallel by default (and remove the `--parallel` flag) to mirror the IDE cache priming.
2025-05-05 23:55:11 +03:00
Chayim Refael Friedman
27dc8ad21b Better manage parallel prime caches
To make best use of available cores, and don't waste time waiting for other tasks. See the comments in the code for explanation.
2025-05-05 23:54:34 +03:00
Lukas Wirth
46df704c89 fix: Remove unnecessary token length check for macros in renaming 2025-05-05 16:54:38 +02:00