Skip to content

fix: Improve diagnostic ranges for macro_calls! #20160

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 3, 2025

Conversation

Veykril
Copy link
Member

@Veykril Veykril commented Jul 3, 2025

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.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 3, 2025
@Veykril Veykril enabled auto-merge July 3, 2025 11:34
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.
@Veykril Veykril force-pushed the push-pqvskktpnylu branch from 5dcd28b to 2480a42 Compare July 3, 2025 12:12
@Veykril Veykril added this pull request to the merge queue Jul 3, 2025
Merged via the queue into rust-lang:master with commit f14bf95 Jul 3, 2025
15 checks passed
@Veykril Veykril deleted the push-pqvskktpnylu branch July 3, 2025 12:35
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants