1260 Commits

Author SHA1 Message Date
Lukas Wirth
7e00f91a72
Merge pull request #19531 from Veykril/push-kxyrpznnllkx
fix: Fix `format_args` lowering for >=1.87
2025-04-06 08:18:23 +00:00
Lukas Wirth
e7ce86ddea fix: Fix format_args lowering for >=1.87 2025-04-06 10:05:56 +02:00
Lukas Wirth
1d1771c15f
Merge pull request #19501 from ChayimFriedman2/macro-expansion
fix: Fix a bug in MBE expansion that arose from incorrect fixing of an older bug in MBE
2025-04-05 13:00:30 +00:00
BenjaminBrienen
2462624a7d prefer default over new 2025-04-04 15:49:50 +02:00
Chayim Refael Friedman
3953b604ce Fix a bug in MBE expansion that arose from incorrect fixing of an older bug in MBE
Specifically, #18744 was the PR that was supposed to fix the old bug, but it fixed it incorrectly (and didn't add a test!) The underlying reason was that we marked metavariables in expansions as joint if they were joint in the macro call, which is incorrect.

This wrong fix causes other bug, #19497, which this PR fixes by removing the old (incorrect) fix.
2025-04-01 21:05:51 +03:00
Lukas Wirth
1e1571e1c8 fix: Fix new nightly lints 2025-03-31 13:27:54 +02:00
Lukas Wirth
faf1b49a9a fix: Fix, clarify and require a value for proc_macro_cwd of CrateData 2025-03-29 08:08:48 +01: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
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
9a5a11fb30 fix: Fix format_args lowering using wrong integer suffix 2025-03-27 08:56:15 +01:00
Lukas Wirth
452e2ca031 feat: parse unsafe record fields 2025-03-25 08:55:31 +01:00
David Barsky
7d050feb5f analysis-stats: expose and print some limited statistics from hir-def 2025-03-24 09:59:51 -07:00
Lukas Wirth
dcd742301e refactor: Replace custom ThinVec with thin-vec crate 2025-03-24 13:44:13 +01:00
Laurențiu Nicola
fcbba4ec72
Merge pull request #19436 from lnicola/rm-rustc-hashes
minor: drop `rustc_hashes` dependency, add `syn` feature
2025-03-24 06:56:05 +00:00
Laurențiu Nicola
7af69a1952 Drop rustc_hashes dependency 2025-03-24 08:28:52 +02: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
Shoyu Vanilla
602b4f37b9 fix: Handle multiple #[repr(..)] attrs correctly 2025-03-22 18:57:37 +09:00
Lukas Wirth
3d9ac497aa fix: Fix incorrect expansion of builtin PartialOrd derive 2025-03-21 12:14:39 +01:00
Lukas Wirth
c365bd96d3 refactor: Do not use Expander in assoc item lowering
`Expander` is a macro expansion solution for body lowering, there is no need to use it here
2025-03-18 11:11:36 +01:00
Lukas Wirth
a505420751 chore: Bump Edition::CURRENT to 2024 2025-03-17 12:29:19 +01:00
Lukas Wirth
a06aadb9f0 internal: Render root syntax contexts more clearly 2025-03-16 16:26:07 +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
92ccf3dd8b cargo fmt 2025-03-15 21:32:01 +01:00
BenjaminBrienen
65617851c5 fix temporary value dropped while borrowed 2025-03-15 21:32:01 +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
Lukas Wirth
02a793bd59 chore: Remove legacy SyntaxContextId re-export 2025-03-15 17:09:17 +01:00
Lukas Wirth
2ea09b2e47 Split variant_data into its own query 2025-03-14 14:16:33 +01:00
Lukas Wirth
8e8d997304 Split enum variants out of enum_data query 2025-03-14 13:32:53 +01:00
Lukas Wirth
dff1896436 Move attribute parsing out of data module 2025-03-14 13:31:41 +01:00
Lukas Wirth
12f54eec27 Split assoc items out of trait_data/impl_data queries 2025-03-14 13:31:41 +01:00
David Barsky
788232b355 internal: don't panic when the crate graph isn't ready #19351 2025-03-13 15:14:08 -04:00
Chayim Refael Friedman
eaa0a39831 Lower Return Type Notation (Type::method(..): Send)
We do it the way rustc does it, by only marking segments with it, and not the whole path. This will allow extending where it is allowed in the future.
2025-03-12 23:34:16 +02:00
Chayim Refael Friedman
3fc655b239
Merge pull request #19337 from ChayimFriedman2/salsify-crate-graph-final
Salsify the crate graph
2025-03-12 19:17:29 +00:00
Chayim Refael Friedman
c94e9efbef Salsify the crate graph
I.e. make it not one giant input but multiple, for incrementality and decreased memory usage for Salsa 3 reasons.
2025-03-12 21:02:30 +02:00
¨Florian
9780734028 Make GenericParamsCollector::type_or_consts not unnecessarily pub(crate) 2025-03-11 15:09:39 +01:00
David Barsky
74620e64ec internal: port rust-analyzer to new Salsa 2025-03-10 13:30:51 -04:00
Lukas Wirth
cf255a61d5
Merge pull request #19079 from ChayimFriedman2/rename-conflict
feat: Warn the user when a rename will change the meaning of the program
2025-03-10 08:59:43 +00:00
¨Florian
5335d8cbc5 Fix syntax fixup producing invalid punctuation
Fixes #19206.
Fixes #18244.
2025-03-08 13:21:00 +01:00
Chayim Refael Friedman
62e7d2851b Warn the user when a rename will change the meaning of the program
Specifically, when a rename of a local will change some code that refers it to refer another local, or some code that refer another local to refer to it.

We do it by introducing a dummy edit with an annotation. I'm not a fond of this approach, but I don't think LSP has a better way.
2025-03-06 21:07:10 +02:00
Thalia Archibald
0811ca0a61 Use size_of from the prelude instead of imported
Use `std::mem::{size_of, size_of_val, align_of, align_of_val}` from the
prelude instead of importing or qualifying them.

These functions were added to all preludes in Rust 1.80.
2025-03-05 00:48:44 -08:00
Lukas Wirth
9200f77068 More precise macro modifiers for syntax highlighting 2025-03-01 17:23:51 +01:00
BenjaminBrienen
b19ef6b046 fix doc tests 2025-02-27 14:58:46 +01:00
Laurențiu Nicola
f641813e07 Format code 2025-02-24 10:28:46 +02:00
Laurențiu Nicola
a5bf2d5604 Add rustc_hashes and bump the others 2025-02-24 10:10:51 +02:00
Laurențiu Nicola
807aa45e0a Merge from rust-lang/rust 2025-02-24 09:42:57 +02:00
Lukas Wirth
0b2e8166a1 Remove limit crate in favor usize 2025-02-23 17:35:09 +01:00
Matthias Krüger
447b34760d
Rollup merge of #137173 - lnicola:sync-from-ra, r=lnicola
Subtree update of `rust-analyzer`

r? `@ghost`
2025-02-17 17:06:14 +01:00