-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Remove trailing semicolon from macro call span #89860
Conversation
Some changes occurred in src/tools/clippy. cc @rust-lang/clippy |
This comment has been minimized.
This comment has been minimized.
063db0c
to
ec66d1c
Compare
Any specific reasons to do this? The change seems fine to me if all bang macro spans are changed, not only statements. |
This comment has been minimized.
This comment has been minimized.
ec66d1c
to
a014d2b
Compare
Honestly I was motivated from finding multiple instances in Clippy where we have to work around the Span surprisingly containing the semicolon. But I also think the output just seems more sensible. It also fixes some wrong "this warning originates in the macro..." messages.
I removed the Also note I added a special case for macros that expand to an expression. The expanded statement in this case will have the pre-expansion span with the semicolon. |
a014d2b
to
f11ef66
Compare
Nah, no span - no need to update it there. |
This comment has been minimized.
This comment has been minimized.
f11ef66
to
1bc61c7
Compare
This comment has been minimized.
This comment has been minimized.
1bc61c7
to
bc0c622
Compare
This comment has been minimized.
This comment has been minimized.
bc0c622
to
c602af8
Compare
This comment has been minimized.
This comment has been minimized.
c602af8
to
6296b6c
Compare
This comment has been minimized.
This comment has been minimized.
Uh oh. Not sure about this one... |
6296b6c
to
99cdbf3
Compare
Restoring |
This comment has been minimized.
This comment has been minimized.
99cdbf3
to
7c78ee2
Compare
This comment has been minimized.
This comment has been minimized.
7c78ee2
to
a9d2fbb
Compare
@bors r- rollup=iffy |
6dcd78b
to
cc4bc57
Compare
@bors r=petrochenkov |
📌 Commit cc4bc57 has been approved by |
⌛ Testing commit cc4bc57 with merge 71e2fcd99e736c8b8bef74894df929a3d9a7d79f... |
The job Click to see the possible cause of the failure (guessed by this bot)
|
💔 Test failed - checks-actions |
@bors retry |
☀️ Test successful - checks-actions |
Finished benchmarking commit (4e89811): comparison url. Summary: This benchmark run did not return any relevant changes. If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf. @rustbot label: -perf-regression |
Macro call site spans are now less surprising/more consistent since they no longer contain a semicolon after the macro call.
The downside is that we need to do a little guesswork to get the semicolon in diagnostics. But this should not be noticeable since it is rare for the semicolon to not immediately follow the macro call.