Commit graph

611 commits

Author SHA1 Message Date
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
Chayim Refael Friedman
b1914e420f Support cfg_select! 2025-07-20 11:56:45 +03:00
Shoyu Vanilla (Flint)
e9968fc555
Merge pull request #20210 from ChayimFriedman2/naked-asm-safe
fix: Inline asm fixes
2025-07-10 06:28:49 +00: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
Chayim Refael Friedman
43644ca4fe
Revert "Re-enable fixpoint iteration for variance computation" 2025-07-08 23:41:22 +03:00
Chayim Refael Friedman
87cddda2d8 Always bump in the parser in err_and_bump()
Even when at curly braces, otherwise the parser can get stuck.

This has happened in the past in #18625, but it was just worked around instead of handling the root of the problem. Now this happened again in #20171. IMO we can't let `err_and_bump()` not bump, that's too confusing and invites errors. We can (as I did) workaround the worse recovery instead.
2025-07-06 03:21:43 +03:00
Chayim Refael Friedman
9c4a7705b1 Fix some things with builtin derives
1. Err on unions on derive where it's required.
 2. Err on `#[derive(Default)]` on enums without `#[default]` variant.
 3. Don't add where bounds `T: Default` when expanding `Default` on enums (structs need that, enums not).

Also, because I was annoyed by that, in minicore, add a way to filter on multiple flags in the line-filter (`// :`). This is required for the `Debug` and `Hash` derives, because the derive should be in the prelude but the trait not.
2025-07-03 23:05:56 +03:00
Lukas Wirth
f14bf95931
Merge pull request #20160 from Veykril/push-pqvskktpnylu
fix: Improve diagnostic ranges for `macro_calls!`
2025-07-03 12:23:23 +00: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
fc2a3bfdab
Merge pull request #20157 from Veykril/push-nxrvpywtvoys
Re-enable fixpoint iteration for variance computation
2025-07-03 09:27:44 +00:00
Lukas Wirth
a3dc41bf97 Re-enable fixpoint iteration for variance computation 2025-07-03 10:48:09 +02:00
Lukas Wirth
661e7d2ac2
Merge pull request #19923 from Veykril/push-rlrsyxsqnxnn
Bump salsa
2025-07-03 08:16:33 +00:00
Lukas Wirth
8029c731ed Bump salsa 2025-07-03 10:05:16 +02:00
Lukas Wirth
115d59f327
Merge pull request #20112 from Veykril/push-ruszuxrqzmvz
Workaround missing none group support in builtin macros
2025-07-03 08:04:16 +00:00
Lukas Wirth
e54759083a Restructure proc-macro loading erros, differentiate hard error property on kind 2025-07-03 09:28:53 +02:00
Lukas Wirth
54c87d8753 Workaround missing none group support in builtin macros 2025-06-27 12:06:23 +02:00
Lukas Wirth
70cbf8332a
Merge pull request #20012 from lnicola/bump-literal-escaper
Some checks are pending
metrics / build_metrics (push) Waiting to run
metrics / other_metrics (diesel-1.4.8) (push) Blocked by required conditions
metrics / other_metrics (hyper-0.14.18) (push) Blocked by required conditions
metrics / other_metrics (ripgrep-13.0.0) (push) Blocked by required conditions
metrics / other_metrics (self) (push) Blocked by required conditions
metrics / other_metrics (webrender-2022) (push) Blocked by required conditions
metrics / generate_final_metrics (push) Blocked by required conditions
rustdoc / rustdoc (push) Waiting to run
Update to literal-escaper 0.0.4
2025-06-24 08:21:36 +00:00
Chayim Refael Friedman
de312d0c71 Don't run doctests 2025-06-23 00:50:22 +03:00
bors
01ccbcf4a8 Auto merge of #142567 - lnicola:sync-from-ra, r=lnicola
Subtree update of `rust-analyzer`

r? `@ghost`
2025-06-17 21:13:37 +00:00
Marijn Schouten
13a46eab7d update to literal-escaper 0.0.4 for better API without unreachable and faster string parsing 2025-06-16 15:12:24 +03:00
Deadbeef
4ca88ff6a9 clarify rustc_do_not_const_check comment 2025-06-15 20:40:08 +08:00
Chayim Refael Friedman
4f54885901 Fix comparison of proc macros
Comparing the TypeId is not enough, they also contain data.
2025-06-12 13:31:55 +03:00
Lukas Wirth
c15fc9a344
Merge pull request #19837 from ChayimFriedman2/stable-astid
Provide better incrementality when items are changed
2025-06-12 06:09:01 +00:00
Chayim Refael Friedman
9a1063f266 LRU ast id map
We can do that and it's pretty heavy.
2025-06-12 08:50:43 +03:00
Chayim Refael Friedman
ed0b4506dd Avoid referring to the item tree except in the def map
Item tree IDs are very unstable (adding an item of a kind invalidates all following items of the same kind). Instead use ast ids, which, since the previous commit, are pretty stable.
2025-06-12 08:50:40 +03:00
Chayim Refael Friedman
4bcf03e28b Use stable AST IDs
Instead of simple numbering, we hash important bits, like the name of the item.

This will allow for much better incrementality, e.g. when you add an item. Currently, this invalidates the IDs of all following items, which invalidates pretty much everything.
2025-06-12 08:47:22 +03:00
Chayim Refael Friedman
7b64b407e8 Correctly handle attr macros placed in cfg_attr in speculative expansion 2025-06-08 01:44:14 +03:00
Lukas Wirth
f0e39c77cc Add some more hir_expand::files conversions 2025-05-30 14:48:56 +02:00
Lukas Wirth
6440fe2a01 Back out "Fix IDE resolution of item macros"
This backs out commit 3e0ab7219a.
2025-05-28 07:09:21 +02:00
Trevor Gross
e6e5e3cc41 chore: Remove support for concat_idents!
`concat_idents!` was deprecated in [1] and will be removed in the near
future. rust-analyzer's support is independent of rustc's, so drop RA
support now to make syncing easier.

[1]: https://github.com/rust-lang/rust/pull/137653
2025-05-28 03:59:32 +00:00
Chayim Refael Friedman
3e0ab7219a Fix IDE resolution of item macros
It wasn't inside the source, because there was no source map.
2025-05-25 17:20:20 +03:00
Hayashi Mikihiro
7c7d440188 add assert to check ast_index smaller than INNER_ATTR_SET_BIT
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-05-08 23:37:47 +09:00
Hayashi Mikihiro
ab4ba5cd29 Remove ast index mask
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-05-06 17:45:09 +09:00
Hayashi Mikihiro
52b523aabe import std::iter::repeat
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-05-06 17:45:09 +09:00
Hayashi Mikihiro
7d6956ea57 Update crates/hir-expand/src/attrs.rs
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2025-05-06 17:45:09 +09:00
Hayashi Mikihiro
b786f98761 Update crates/hir-expand/src/attrs.rs
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
2025-05-06 17:45:09 +09:00
Hayashi Mikihiro
9f6b4255c2 fix: resolve doc path if outer comments exist on module and replace from cfg_attr bit to doc_place bit
Signed-off-by: Hayashi Mikihiro <34ttrweoewiwe28@gmail.com>
2025-05-06 17:45:09 +09:00
Lukas Wirth
d40455fec0
Merge pull request #19749 from Veykril/push-tsxvxzzmlxpq
refactor: Remove unnecessary `AsAny` trait
2025-05-05 14:53:57 +00:00
Lukas Wirth
091b7b2465 refactor: Remove unnecessary AsAny trait 2025-05-05 16:42:17 +02:00
Vishruth-Thimmaiah
109d933736
fix: negative nums in concat! expansion 2025-05-05 19:00:24 +05:30
Lukas Wirth
f9c83edf12 fix: Fix move_bounds assists not working for lifetimes 2025-05-05 15:07:36 +02:00
Matthias Krüger
573c47c9ba remove a couple of clones 2025-05-01 11:41:42 +02:00
Lukas Wirth
996d6ed1a3 Split out salsa_macros
Does not do much yet due to tracing pulling syn but oh well
2025-04-29 19:43:36 +02:00
Lukas Wirth
4cc6ee3f01 refactor: Remove unnecessary extension trait 2025-04-29 13:53:57 +02:00
Lukas Wirth
d11dbf648f Cleanup cfg check handling in expression store lowering 2025-04-29 11:44:11 +02:00
David Barsky
fe7b4f2ad9
Merge pull request #19699 from ChayimFriedman2/escape-label
fix: Escape raw names in labels properly
2025-04-28 21:12:21 +00:00
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
Laurențiu Nicola
6225bb9c44 Merge from rust-lang/rust 2025-04-28 11:06:53 +03:00