about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-09-17Fix complete type in nested patternA4-Tacks-0/+20
Example --- ```rust struct Foo { num: u32 } struct Bar(Foo); fn foo(Bar($0)) {} ``` **Before this PR**: ```rust struct Foo { num: u32 } struct Bar(Foo); fn foo(Bar(Foo { num$1 }: Foo$0)) {} ``` **After this PR**: ```rust struct Foo { num: u32 } struct Bar(Foo); fn foo(Bar(Foo { num$1 }$0)) {} ```
2025-09-13Merge pull request #20657 from A4-Tacks/fix-before-else-incomplete-letLaurențiu Nicola-1/+51
Fix extra semicolon before else in let-stmt
2025-09-12Fix extra semicolon before else in let-stmtA4-Tacks-1/+51
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-11Merge pull request #20642 from ChayimFriedman2/wasm-safeShoyu Vanilla (Flint)-89/+257
fix: Make `#[target_feature]` always safe on WASM
2025-09-11Merge pull request #20653 from A4-Tacks/gen-function-empty-gen-paramLaurențiu Nicola-1/+30
Fix empty generic param list for generate_function
2025-09-11Fix empty generic param list for generate_functionA4-Tacks-1/+30
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-10Merge pull request #20649 from ChayimFriedman2/cast-unknownShoyu Vanilla (Flint)-6/+25
fix: Always coerce in a cast, even when there are unknown types
2025-09-10Always coerce in a cast, even when there are unknown typesChayim Refael Friedman-6/+25
This cause the relationships between inference vars to get recorded.
2025-09-10Merge pull request #20645 from ChayimFriedman2/update-rustcShoyu Vanilla (Flint)-330/+468
internal: Upgrade rustc crates
2025-09-10Merge pull request #20647 from ChayimFriedman2/ns-projectionsShoyu Vanilla (Flint)-199/+266
fix: Fix normalization in the new solver
2025-09-10Properly handle normalizationChayim Refael Friedman-198/+235
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-10An associated type is not a projection!Chayim Refael Friedman-1/+31
More correctly, a `TyKind::AssociatedType` is not the same as `TyKind::Projection`. We used to map next-solver `TyKind::Alias` to Chalk's `TyKind::AssociatedType`. This is very incorrect, as `AssociatedType` is assumed to be fully normalized, and caused a lot of type mismatches. Unfortunately fixing this causes a lot of stack overflows, because the next solver doesn't have something akin to `AssociatedType` so we normalize again and again. The reason is that is the lazy-normalization nature of the next solver, which means we need to stop normalizing everything. This will be fixed in the next commit.
2025-09-10Adopt even more custom types in the new solverChayim Refael Friedman-222/+220
A lot of simplification and fun.
2025-09-10Upgrade rustc crates and handle changes to canonicalizationChayim Refael Friedman-116/+256
They have to do with diagnostics, we could probably not support them but we will also someday want good diagnostics. The code is mostly copied from rustc.
2025-09-09Merge pull request #20613 from A4-Tacks/diag-unresolved-field-fixes-wsDavid Barsky-13/+52
Fix indent for unresolved_field fixes
2025-09-09Merge pull request #20639 from ChayimFriedman2/update-test-absDavid Barsky-23/+85
fix: Resolve paths to snapshot test libraries absolutely
2025-09-09Merge pull request #20578 from ShoyuVanilla/inftblChayim Refael Friedman-819/+2071
Migrate `InferenceTable` into next-solver
2025-09-10Fix failing tests and fill-in missing detailsShoyu Vanilla-1428/+914
2025-09-09WIP switch inference table to next-solverjackh726-526/+2292
2025-09-09Make `#[target_feature]` safe always on WASMChayim Refael Friedman-11/+69
Even when the feature isn't enabled, as it's not UB to invoke an undefined feature in WASM (just a trap).
2025-09-09Expand target info to include the architectureChayim Refael Friedman-78/+188
And make it easier to expand it more in the future, if needed.
2025-09-09Resolve paths to snapshot test libraries absolutelyChayim Refael Friedman-23/+85
That is, resolve them globally, not from the test's location. This *should* result in more robust resolution; for example, previously the code failed to detect the presence of snapshot testing if the snapshot library was renamed in the dependency or was an indirect dependency.
2025-09-09Merge pull request #20624 from A4-Tacks/fix-syn-lifetime-boundsChayim Refael Friedman-7/+6
Fix LifetimeParam::lifetime_bounds invalid implement
2025-09-09Merge pull request #20638 from Kobzol/book-share-cacheChayim Refael Friedman-0/+10
Add a FAQ entry about RA and Cargo build lock/cache conflicts
2025-09-09Fix LifetimeParam::lifetime_bounds invalid implementA4-Tacks-7/+6
Lifetime node example: ``` LIFETIME_PARAM@15..21 LIFETIME@15..17 LIFETIME_IDENT@15..17 "'a" COLON@17..18 ":" WHITESPACE@18..19 " " TYPE_BOUND_LIST@19..21 TYPE_BOUND@19..21 LIFETIME@19..21 LIFETIME_IDENT@19..21 "'b" ```
2025-09-09Add a FAQ entry about RA and Cargo interactionJakub Beránek-0/+9
2025-09-09Update documentation about how to build the RA bookJakub Beránek-0/+1
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-08Merge pull request #20633 from Wilfred/improve_introChayim Refael Friedman-9/+29
Clarify intro in README and manual
2025-09-08Clarify intro in README and manualWilfred Hughes-9/+29
The first sentence a new user should see should ideally answer the questions: * What is rust-analyzer? * Why might I want to use it? The vast majority of users will be interested in using rust-analyzer inside their favourite editor. We should clarify that rust-analyzer is an LSP implementation and that it supports all the classic IDE features. Whilst it's also true that rust-analyzer is modular and organised into libraries, the first impression should (I think) focus on an overview and the primary use case.
2025-09-08Merge pull request #20631 from Wilfred/remove_register_attrChayim Refael Friedman-62/+14
Remove support for register_attr
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)-579/+446
internal: Upgrade rustc crates
2025-09-04Upgrade rustc cratesChayim Refael Friedman-579/+446
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-04Merge pull request #20606 from ChayimFriedman2/reborrow-config-typoChayim Refael Friedman-1/+1
fix: Fix typo in config
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-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-02Merge pull request #20587 from ChayimFriedman2/private-inherentLaurențiu Nicola-8/+47
fix: Deduplicate methods in completion by function ID and not by name
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.