Commit graph

601 commits

Author SHA1 Message Date
Lukas Wirth
aed0fec1a9 Auto-attach database in Analysis calls 2025-08-18 09:52:23 +02:00
jackh726
9418a3f2df Implement next trait solver 2025-08-09 16:08:58 +00: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
Shoyu Vanilla
e587367b4d fix: Apply adjusts to pats and exprs when doing pat analysis 2025-07-22 01:18:48 +09:00
Chayim Refael Friedman
f19c89da36 Infer lifetimes for GATs in expression/pattern position
We should not only in type position.
2025-07-15 01:15:33 +03:00
Chayim Refael Friedman
bd8087e86e Differentiate between asm!(), global_asm!() and naked_asm!(), and make only asm!() unsafe 2025-07-09 17:37:27 +03:00
Shoyu Vanilla
f3eb22edd0 fix: Closure capturing for let exprs, again 2025-07-03 22:51:16 +09: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
b50d527931
Merge pull request #20036 from Veykril/push-yquvoyrxkksx
Do not default to 'static for trait object lifetimes
2025-06-24 06:59:54 +00:00
Lukas Wirth
2b05bd7d7e Do not default to 'static for trait object lifetimes
We lack trait object default lifetime elision, so `'static` can be wrong at times, confusing the user
2025-06-24 08:49:24 +02:00
Chayim Refael Friedman
de312d0c71 Don't run doctests 2025-06-23 00:50:22 +03:00
Shoyu Vanilla
4f8767d790 Minic rustc's new format_args! expansion 2025-06-22 13:22:28 +09:00
Shoyu Vanilla
5f401e3ce6 fix: Closure capturing for let exprs 2025-06-19 01:30:10 +09:00
Chayim Refael Friedman
b46593ece2 Never make type mismatch diagnostic stable, even when there is a fix
We show fixes now even for experimental diagnostics anyway, and it has false positives.
2025-06-17 12:48:19 +03:00
Lukas Wirth
03f1003637 chore: Start infesting ide crates with 'db lifetime 2025-06-17 10:42:38 +02:00
Lukas Wirth
eb25f5e85b
Merge pull request #19945 from ChayimFriedman2/private-field-quickfix
feat: Add the quickfix for increasing visibility of a private field to the private-field diagnostic (previously it was only on no-such-field)
2025-06-17 08:19:09 +00:00
Lukas Wirth
f15267aaf4
Merge pull request #19963 from ChayimFriedman2/unsized-impl-items
fix: Do not error at impls for unsized types that do not include `where Self: Sized` items
2025-06-10 11:37:30 +00:00
Chayim Refael Friedman
6f4a6d4349 Do not error at impls for unsized types that do not include where Self: Sized items 2025-06-10 14:04:21 +03:00
Chayim Refael Friedman
14cb64c9d9 Stabilize the "JSON is not Rust" diagnostic 2025-06-09 00:35:40 +03:00
Chayim Refael Friedman
ba6f6e2e34 Add the quickfix for increasing visibility of a private field to the private-field diagnostic (previously it was only on no-such-field)
The difference between the diagnostics is that no-such-field is for record struct construction, while private-field is for dot syntax.

I tried to unify them, but there is a bit of uniqueness in each. This is possible but maybe not worth it.

Also, fix the quickfix when there is already a visibility to the field (replace it instead of appending to it).
2025-06-08 15:17:34 +03:00
Chayim Refael Friedman
41f5de12bd Stabilize unlinked file diagnostic 2025-06-06 03:55:57 +03:00
Tyler Breisacher
4055436776 Add a quickfix for accessing a private field of a struct 2025-06-02 22:45:34 -07: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
1f0052a496 fix: Fix import insertion not being fully cfg aware 2025-05-29 14:55:09 +02:00
Shoyu Vanilla
8682c1b9b4 fix: Skip pattern analysis on type mismatches 2025-05-28 08:11:14 +09:00
Lukas Wirth
d146d3bc90
Merge pull request #19851 from ChayimFriedman2/normalize-exhaustiveness
fix: Normalize when checking for uninhabited types for pattern exhaustiveness checking
2025-05-26 07:19:12 +00:00
Chayim Refael Friedman
f17bbfc48b Normalize when checking for uninhabited types for pattern exhaustiveness checking 2025-05-23 01:01:21 +03:00
Chayim Refael Friedman
2d32f025e7 Fix cache problems with lints level
By removing the cache.
2025-05-19 15:36:01 +03:00
Chayim Refael Friedman
5ed11234cc Improve asm support
Including:

 - Infer `label {}` and `const` operands.
 - Correctly handle unsafe check inside `label {}`.
 - Fix an embarrassing parser typo that cause labels to never be part of the AST
2025-05-15 23:36:00 +03:00
Florian Diebold
40b7f4af27 Make diagnostics experimental by default 2025-05-09 16:15:48 +02:00
Lukas Wirth
581646236e refactor: De-arc defmap queries 2025-05-05 09:04:52 +02:00
Lukas Wirth
235d88bf42 Render more lifetimes 2025-05-02 14:36:18 +02:00
Matthias Krüger
573c47c9ba remove a couple of clones 2025-05-01 11:41:42 +02:00
Lukas Wirth
1ad31eff67
Merge pull request #19247 from alibektas/19172_very_new
fix: Correct span info for mir::Operand
2025-04-30 10:13:02 +00:00
Prajwal S N
2eb7389b63
refactor: migrate let_else_to_match to editor
Signed-off-by: Prajwal S N <prajwalnadig21@gmail.com>
2025-04-28 17:19:17 +05:30
Lukas Wirth
0fee71065b
Merge pull request #19704 from Veykril/push-wrvznvvpvtvp
Add expression fill mode variant for filling with underscore expressions
2025-04-28 09:45:04 +00:00
Lukas Wirth
7e526b6be7 Add expression fill mode variant for filling with underscore expressions 2025-04-28 10:39:36 +02:00
Lukas Wirth
dce59ad8fb fix: Fix type argument mismatch incorrectly triggering on inferred trait args 2025-04-24 09:16:01 +02:00
Chayim Refael Friedman
adcf699ea3 Properly handle lifetimes when checking generic arguments len
And also, prepare for correct lowering of lifetime. We still don't handle most lifetimes correctly, but a bit more of the foundation to lifetime elision is now implemented.
2025-04-24 08:35:20 +03:00
Lukas Wirth
d3b6d88386 fix: Fix incorrect diagnostic for lifetime parameter count mismatch 2025-04-23 16:36:13 +02:00
Lukas Wirth
35063ee389 Mark incorrect_generics_len diagnostic as experimental 2025-04-23 12:28:47 +02:00
Chayim Refael Friedman
99ce53b1d7 Add two new diagnostics: one for mismatch in generic arguments count, and another for mismatch in their kind
Also known as E0747 and E0107.

And by the way, rewrite how we lower generic arguments and deduplicate it between paths and method calls. The new version is taken almost straight from rustc.

This commit also changes the binders of `generic_defaults()`, to only include the binders of the arguments up to (and not including) the current argument. This make it easier to handle it in the rewritten lowering of generic args. It's also how rustc does it.
2025-04-22 14:55:43 +03:00
Chayim Refael Friedman
0f325c7ff8 Remove unnecessary predefined symbol clones
Now that they're const it's no longer needed.

Nothing manual was performed: only a regexp search of `sym::([\w][\w\d]*)\.clone\(\)` and replace by `sym::$1`.
2025-04-21 03:10:13 +03:00
bbb651
c7cf6bf7c3 doc: Fix dead manual links 2025-04-20 20:28:52 +03:00
Chayim Refael Friedman
c58ddafe90 Make HirFileId, EditionedFileId and macro files Salsa struct
And make more queries non-interned.

Also flip the default for queries, now the default is to not intern and to intern a query you need to say `invoke_interned`.
2025-04-19 22:10:52 +03:00
Lukas Wirth
4bef2bf192
Merge pull request #19590 from roife/fix-issue-19540
feat: add `pub(crate) mod` option for unlinked files
2025-04-16 07:43:43 +00:00
roifewu
7fde3fcd2e feat: Add pub(crate) mod option for unlinked files 2025-04-15 13:12:03 +08:00
Lukas Wirth
8df812f14d fix: Walk const block expressions for unsafety checking 2025-04-10 16:10:30 +02:00
Chayim Refael Friedman
8a9a1e3345 Remove all upcasts!
It turns out there were a lot redundant too.
2025-04-10 11:08:38 +03:00