955 Commits

Author SHA1 Message Date
Lukas Wirth
34e7d60e30
Merge pull request #19644 from ChayimFriedman2/const-syms
internal: Make predefined symbols `const` instead of `static`
2025-04-21 12:34:59 +00:00
Lukas Wirth
d16b862ea5 fix: Support unstable UnsafePinned struct in type layout calc 2025-04-21 09:35:30 +02: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
Chayim Refael Friedman
9477e46bec Get rid of static predefined symbols
Make them all `const`.
2025-04-21 03:07:35 +03:00
jackh726
6daa791fab Update chalk 2025-04-20 16:20:08 +00: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
32052e5054
Merge pull request #19616 from ChayimFriedman2/transparent-diags
internal: Make hir-ty non-diagnostic queries transparent
2025-04-18 08:53:53 +00:00
Chayim Refael Friedman
5e3a914dc2 Make hir-ty non-diagnostic queries transparent
That is, all queries that have a `with_diagnostic` variant.

Them being tracked was (maybe) needed before #19462, because back then diagnostics could refer `AstId`s (for macro types), but now they are no longer needed.
2025-04-18 07:04:13 +03:00
Chayim Refael Friedman
e1962d2e22 Fix a bug with predicate lowering of associated items
The essence of the bug is that bounds on `impl Trait` got lowered with incorrect bound vars, as if we were lowering the parent.
2025-04-17 00:19:54 +03:00
Chayim Refael Friedman
cdc5ba30fc Prevent panics when there is a cyclic dependency between closures
We didn't include them in the sorted closures list, therefore didn't analyze them, then failed to find them.
2025-04-14 07:12:51 +03:00
Florian Diebold
1bf840bb50
Merge pull request #19566 from flodiebold/push-vzpyzvpkwkyt
Fix dyn compatibility code bypassing callable_item_signature query
2025-04-10 15:11:34 +00:00
Florian Diebold
6e06115e6d Fix dyn compatibility code bypassing callable_item_signature query 2025-04-10 16:56:17 +02:00
Lukas Wirth
8df812f14d fix: Walk const block expressions for unsafety checking 2025-04-10 16:10:30 +02:00
Lukas Wirth
4fdc2507c6 fix: Fix invalid signature bitflags 2025-04-10 15:39:27 +02:00
Lukas Wirth
f880acd18c
Merge pull request #19461 from Hmikihiro/shadow_by_module
fix: shadow type by module
2025-04-10 12:20:14 +00: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
Hayashi Mikihiro
1b471ebfd5 TypeNs contain module
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-04-10 16:29:10 +09:00
Hayashi Mikihiro
a7dc60a2c4 return single option
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-04-10 16:29:10 +09:00
Hayashi Mikihiro
2854ad9a41 fix: shadow type by module
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-04-10 16:29:10 +09:00
Lukas Wirth
07212140db refactor: Turn LifetimeRef into an enum
This makes things more structured
2025-04-09 15:58:06 +02:00
Lukas Wirth
dc363f7f77
Merge pull request #19462 from Veykril/push-ypvprvvwkyll
refactor: Lower type-refs before type inference
2025-04-09 08:54:28 +00:00
Lukas Wirth
1fd9520c92 refactor: Lower type-refs before type inference
This refactors how we deal with items in hir-def lowering.

- It now lowers all of them through an "ExpressionStore" (kind of a misnomer as this point) as their so called *Signatures.
- We now uniformly lower type AST into TypeRefs before type inference.
- Likewise, this moves macro expansion out of type inference, resulting in a single place where we do non-defmap macro expansion.
- Finally, this PR removes a lot of information from ItemTree, making the DefMap a lot less likely to be recomputed and have it only depend on actual early name resolution related information (not 100% true, we still have ADT fields in there but thats a follow up removal).
2025-04-09 10:43:23 +02:00
David Barsky
f3f6b5f4f1
Merge pull request #19536 from jackh726/closure-infer
Port closure inference from rustc
2025-04-08 14:17:30 +00:00
jackh726
bc3e9d9fcb Port closure inference from rustc 2025-04-07 21:48:01 +00:00
Lukas Wirth
a2783704bf
Merge pull request #19432 from ShoyuVanilla/issue-19431
fix: Yet another false positive invalid cast diagnostic
2025-04-07 10:29:54 +00:00
Lukas Wirth
e7ce86ddea fix: Fix format_args lowering for >=1.87 2025-04-06 10:05:56 +02:00
Lukas Wirth
bcc8e3a0b6 chore: Replace some invokes with invoke_actual in hir-ty 2025-04-01 13:13:20 +02:00
Chayim Refael Friedman
cdcadb4265
Merge pull request #19492 from ChayimFriedman2/experiment
Avoid relying on `block_def_map()` needlessly
2025-04-01 04:08:26 +00:00
Chayim Refael Friedman
2d99b5ead5 Avoid relying on block_def_map() needlessly
We can compute the wanted information from the block's interned data.
2025-04-01 06:58:21 +03:00
Lukas Wirth
1e1571e1c8 fix: Fix new nightly lints 2025-03-31 13:27:54 +02:00
Lukas Wirth
2e1ff255ae
Merge pull request #19375 from ChayimFriedman2/do-not-complete
feat: Allow crate authors to control completion of their things
2025-03-28 09:06:19 +00:00
Chayim Refael Friedman
246d678d77 Fix a bug in orphan rules calculation
Where a fundamental type applied twice wasn't considered local.
2025-03-28 05:37:29 +03:00
Chayim Refael Friedman
7b584ef9bf Allow crate authors to control completion of their things
Via the new `#[rust_analyzer::completions(...)]` attribute.

Also fix a bug with existing settings for that where the paths wouldn't resolve correctly.
2025-03-27 14:01:26 +02:00
Lukas Wirth
7a1e9c4b0c ci: Require miri step 2025-03-25 08:10:27 +01:00
Lukas Wirth
dcd742301e refactor: Replace custom ThinVec with thin-vec crate 2025-03-24 13:44:13 +01:00
Shoyu Vanilla
9cfea3ec29 fix: Yet another false positive invalid cast diagnostic 2025-03-24 02:34:24 +09:00
Lukas Wirth
500ea05aef chore: Bump dependencies 2025-03-23 08:46:10 +01:00
Lukas Wirth
d4122434dd chore: Remove unused dependencies 2025-03-23 08:08:17 +01:00
Lukas Wirth
2e5e5113df
Merge pull request #19416 from ShoyuVanilla/issue-15037
fix: Handle multiple `#[repr(..)]` attrs correctly
2025-03-22 17:53:24 +00:00
Shoyu Vanilla
602b4f37b9 fix: Handle multiple #[repr(..)] attrs correctly 2025-03-22 18:57:37 +09:00
Shoyu Vanilla
b07a76d6af fix: Properly calculate the layouts of tuple ptrs whose last fields are DST 2025-03-22 12:57:28 +09:00
Ali Bektas
9f333a6ea2 change test name to sth meaningful 2025-03-19 01:59:01 +01:00
Ali Bektas
acc4c3339d Fix span info for mir::Operand
Fixes #19172
2025-03-19 01:45:51 +01:00
Lukas Wirth
a505420751 chore: Bump Edition::CURRENT to 2024 2025-03-17 12:29:19 +01:00
Lukas Wirth
918740358b
Merge pull request #19354 from ChayimFriedman2/rtn-prep
Preparation to Return Type Notation (RTN)
2025-03-16 13:21:23 +00:00
Lukas Wirth
b5eedad8e3 refactor: Remove unnecessary Arc 2025-03-16 10:27:48 +01:00
BenjaminBrienen
7535bb4661 cargo fmt 2025-03-15 21:32:01 +01:00
BenjaminBrienen
7f1912c748 cargo clippy --fix 2025-03-15 21:32:01 +01:00
BenjaminBrienen
aad66c7bf1 Fix 2024 syntax errors 2025-03-15 21:32:01 +01:00
Lukas Wirth
2ea09b2e47 Split variant_data into its own query 2025-03-14 14:16:33 +01:00