Skip to content
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

Wrong span used in non_fmt_panic lint for panic!(a!()) #82109

Closed
m-ou-se opened this issue Feb 14, 2021 · 0 comments · Fixed by #82113
Closed

Wrong span used in non_fmt_panic lint for panic!(a!()) #82109

m-ou-se opened this issue Feb 14, 2021 · 0 comments · Fixed by #82113
Assignees
Labels
A-diagnostics Area: Messages for errors, warnings, and lints D-papercut Diagnostics: An error or lint that needs small tweaks.

Comments

@m-ou-se
Copy link
Member

m-ou-se commented Feb 14, 2021

The non_fmt_panic lint points inside the definition of a in:

panic!(a!())

Because the argument of panic!() is entirely a!(), we get the span inside of as definition. We should walk up the macro backtrace to find the span of a!() itself in this snippet.

@m-ou-se m-ou-se added A-diagnostics Area: Messages for errors, warnings, and lints D-papercut Diagnostics: An error or lint that needs small tweaks. labels Feb 14, 2021
@m-ou-se m-ou-se self-assigned this Feb 14, 2021
@bors bors closed this as completed in 547b3ad Feb 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints D-papercut Diagnostics: An error or lint that needs small tweaks.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant