about summary refs log tree commit diff
path: root/src/tools/rust-analyzer/crates
AgeCommit message (Collapse)AuthorLines
2025-09-08Skip flycheck for workspace if it is already being checkedIfeanyi Orizu-9/+16
2025-09-08Merge pull request #20632 from rmehri01/navigation-on-primsChayim Refael Friedman-139/+244
feat: support navigation on primitives
2025-09-08make TryToNav take Semantics instead of RootDatabaseRyan Mehri-124/+203
2025-09-08add testRyan Mehri-0/+14
2025-09-08impl TryToNav for BuiltinType insteadRyan Mehri-30/+32
2025-09-08feat: support navigation on primitivesRyan Mehri-17/+27
2025-09-08Remove support for register_attrWilfred Hughes-62/+14
This was removed in rustc in 2022: https://github.com/rust-lang/rust/pull/101123 Closes #20525.
2025-09-08Merge pull request #20620 from A4-Tacks/let-else-completionLaurențiu Nicola-17/+220
fix: add `else` keyword completion after `let` statements
2025-09-08Merge pull request #20626 from A4-Tacks/make-record-wsLaurențiu Nicola-36/+39
Improve make::struct_ field_list whitespace
2025-09-07Improve make::struct_ field_list whitespaceA4-Tacks-36/+39
Example --- **Before this PR**: ```rust struct Variant{ field: u32 } ``` **After this PR**: ```rust struct Variant { field: u32 } ```
2025-09-06Add allow `else` keyword completion in LetStmtA4-Tacks-17/+220
Example --- ```rust fn foo() { let _ = 2 el$0 } ``` -> ```rust fn foo() { let _ = 2 else { $0 }; } ```
2025-09-05Fix indent for unresolved_field fixesA4-Tacks-13/+52
Examples --- ```rust mod indent { struct Foo {} fn foo() { let foo = Foo{}; foo.bar$0; } } ``` **Before this PR**: ```rust mod indent { struct Foo { bar: () } fn foo() { let foo = Foo{}; foo.bar; } } ``` **After this PR**: ```rust mod indent { struct Foo { bar: () } fn foo() { let foo = Foo{}; foo.bar; } } ``` --- New field list add newline ```rust mod indent { struct Foo; fn foo() { Foo.bar$0; } } ``` **Before this PR**: ```rust mod indent { struct Foo{ bar: () } fn foo() { Foo.bar; } } ``` **After this PR**: ```rust mod indent { struct Foo { bar: (), } fn foo() { Foo.bar; } } ```
2025-09-05Merge pull request #20609 from ChayimFriedman2/update-rustcShoyu Vanilla (Flint)-530/+402
internal: Upgrade rustc crates
2025-09-05Fix precedence parenthesis for replace_arith_opA4-Tacks-1/+22
Example --- ```rust fn main() { let x = 1*x $0+ 2; } ``` **Before this PR**: ```rust fn main() { let x = 1*x.wrapping_add(2); } ``` **After this PR**: ```rust fn main() { let x = (1*x).wrapping_add(2); } ```
2025-09-04Upgrade rustc cratesChayim Refael Friedman-530/+402
The main changes are (there are some other small changes): - Using a specific type for trait IDs in the new solver, allowing us to simplify a lot of code. - Add `BoundConst` similar to `BoundTy` and `BoundRegion` (previously consts used `BoundVar` directly), due to a new trait requirement.
2025-09-04Merge pull request #20607 from ChayimFriedman2/ns-dyn-mismatchChayim Refael Friedman-1/+22
internal: Add a regression test for a fixed new trait solver bug
2025-09-04Add a regression test for a fixed new trait solver bugChayim Refael Friedman-1/+22
Not sure what exactly fixed it, but why not.
2025-09-04Fix typo in configChayim Refael Friedman-1/+1
To make it backwards-compatible.
2025-09-04Add cfg_attr predicate completionA4-Tacks-1/+53
Example --- ```rust #[cfg_attr($0, must_use)] struct Foo; ```
2025-09-03Add applicable on bang `!` for apply_demorganA4-Tacks-7/+28
Example --- ```rust fn f() { $0!(1 || 3 && 4 || 5) } ``` -> ```rust fn f() { !1 && !(3 && 4) && !5 } ```
2025-09-03Merge pull request #20586 from ChayimFriedman2/placeholder-nsShoyu Vanilla (Flint)-233/+324
fix: Make sense of the mess that were (are) different kind of generics in the solver
2025-09-03Fix closure in match not applicable for add_bracesA4-Tacks-2/+31
Example --- **Not applicable**: ```rust fn foo() { match () { () => { t(|n|$0 n + 100); } } } ```
2025-09-02Deduplicate methods in completion by function ID and not by nameChayim Refael Friedman-8/+47
Because duplicates can be found with traits. Worse, the inherent methods could be private, and we'll discover that only later. But even if they're not they're different methods, and its seems worthy to present them all to the user.
2025-09-02Make sense of the mess that were (are) different kind of generics in the solverChayim Refael Friedman-233/+324
To the extent possible. Previously they were confused. Sometimes generic params were treated as `Param` and sometimes as `Placeholder`. A completely redundant (in the new solver) mapping of salsa::Id to ints to intern some info where we could just store it uninterned (not in Chalk though, for some weird reason). Plus fix a cute bug in closure substitution that was caught by the assertions of Chalk but the next solver did not have such assertions. Do we need more assertions?
2025-08-30Pass `--target` before `--` for `cargo rustc`Elliot Roberts-5/+2
2025-08-30Merge pull request #20563 from ChayimFriedman2/ns-projection-dyn-auto-traitShoyu Vanilla (Flint)-1/+70
fix: When mapping next-solver's `dyn` type, add `Self` (aka. bound var ^1.0) to auto traits' substitutions
2025-08-29Merge pull request #20560 from ChayimFriedman2/analysis-stats-improveLukas Wirth-3/+52
fix: Add progress bars to more places in analysis-stats
2025-08-28When mapping next-solver's `dyn` type, add `Self` (aka. bound var ^1.0) to ↵Chayim Refael Friedman-1/+70
auto traits' substitutions Chalk represents dyn types as a list of predicate, the self type should be there. The next solver represents them quite differently. The `Self` was forgotten for the auto trait case.
2025-08-28Don't require a full `InferenceTable` for `CastTy`Chayim Refael Friedman-59/+52
A DB is enough.
2025-08-28Add progress bars to more places in analysis-statsChayim Refael Friedman-3/+52
Namely, mir lowering, const eval and IDE things.
2025-08-28Attach the db in one more place in highlightingChayim Refael Friedman-1/+2
2025-08-27Merge pull request #20547 from ChayimFriedman2/highlight-related-unsafe-scopeLaurențiu Nicola-10/+44
fix: In highlight_related, when on an unsafe block, don't highlight unsafe operations of other unsafe blocks
2025-08-27Merge pull request #20527 from ChayimFriedman2/cache-next-solverShoyu Vanilla (Flint)-66/+140
perf: Cache trait solving across queries in the same revision
2025-08-26In highlight_related, when on an unsafe block, don't highlight unsafe ↵Chayim Refael Friedman-10/+44
operations of other unsafe blocks
2025-08-26Remove `SolverDefId::ForeignId`Chayim Refael Friedman-7/+4
Replace it with normal `SolverDefId::TypeAliasId`. The split caused a very funny bug where code was getting `TypeAliasId` where it expected `ForeignId`, because `TypeAliasId` had a `From` impl from `hir_def::TypeAliasId` and `ForeignId` had not, plus a careless `into()`. I could've fixed this specific bug but opted to remove the split instead; currently, it just provides more room for bugs, as we don't have typed IDs for the solver anyway, and even when we'll have (hopefully), that doesn't seem like a very useful distinction, for example in hir-def foreign types are just `TypeAliasId` with some flags. Constructing a test for this isn't trivial; the trivial test (creating a foreign type, even proving a trait bound for it) fails to fail before the change, probably because we don't use the new solver everywhere yet so we don't trigger this specific code path.
2025-08-27fix: Prevent invalid transformation in 'Replace match with if let' assistsgasho-1/+23
2025-08-26Merge pull request #20399 from rust-lang/veykril/push-klrwvmzokqwuShoyu Vanilla (Flint)-2/+2
Enable warning logs by default
2025-08-26Merge pull request #20534 from A4-Tacks/tog-macro-delim-semicolonShoyu Vanilla (Flint)-3/+33
Fix ExprStmt delete semicolon for toggle_macro_delimiter
2025-08-26Merge pull request #20509 from A4-Tacks/fix-move-guard-to-arm-indentShoyu Vanilla (Flint)-13/+57
Fix indent for move_guard_to_arm_body
2025-08-26Merge pull request #20520 from ChayimFriedman2/reborrowShoyu Vanilla (Flint)-5/+67
feat: Add an option to remove reborrows from adjustment inlay hints
2025-08-26Merge pull request #20537 from ChayimFriedman2/new-solver-normalizeShoyu Vanilla (Flint)-6/+45
fix: Normalize all types when finishing inference
2025-08-25Merge pull request #20423 from ShoyuVanilla/import-2024Chayim Refael Friedman-50/+219
Make import sorting order follow 2024 edition style
2025-08-25Don't map Chalk's `Normalize` to next solver's `NormalizesTo`Chayim Refael Friedman-6/+16
`NormalizesTo` is a private predicate that should not be used outside the solver. For normalization, rustc uses `AliasRelate`, so replace with that.
2025-08-25Normalize all types when finishing inferenceChayim Refael Friedman-0/+29
The new solver does not eagerly normalize, but things after inference expect types to be normalized. rustc does the same. Also, I'm afraid other things in r-a don't expect results of the solver to be unnormalized. We'll need to handle that.
2025-08-25Cache trait solving across queries in the same revisionChayim Refael Friedman-66/+140
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-25Fix ExprStmt delete semicolon for toggle_macro_delimiterA4-Tacks-3/+33
2025-08-24fix: Masquerade as nightly cargo when invoking flycheck with `-Zscript`Shoyu Vanilla-0/+1
2025-08-24Merge pull request #20523 from ChayimFriedman2/opaque-genericsShoyu Vanilla (Flint)-43/+54
fix: Fix opaque generics
2025-08-24Fix opaque genericsChayim Refael Friedman-43/+54
The parent generics were incorrectly not considered for TAIT. I'm not convinced we should follow rustc here, also there are items (opaques) with more than 1 parent (opaque -> fn/type alias -> impl/trait) and I'm not sure we properly account for that in all places, but for now I left it as-is. Also fix a bug where lifetimes' indices were incorrect when there is a self param (they started from 0 instead of 1).
2025-08-24Merge pull request #20507 from A4-Tacks/suggest-return-exprChayim Refael Friedman-3/+54
Add ReturnExpr completion suggest