-
Notifications
You must be signed in to change notification settings - Fork 1.8k
fix(manual_assert): don't lint on if cfg!(..) { panic!(..) }
#15651
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
base: master
Are you sure you want to change the base?
Conversation
r? @Alexendoo rustbot has assigned @Alexendoo. Use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that really a common idiom? If this is used through the debug_panic
crate for example, shouldn't we instead refrain from linting code expanded from an external macro when we detect this pattern?
r? samueltardieu
That is what the issue author was suggesting at least.
I think that's an orthogonal but good idea, yes. |
Yes, but it would be better if it was backed up by some numbers. Otherwise, we are just preventing the lint from triggering in legitimate situations. If this is not that common, the lint can just be allowed by users who want to do this. |
In that case, would you want to go ask the issue author for some numbers/close the issue EDIT: there's a from-expansion check already in place:
|
☔ The latest upstream changes (possibly #13787) made this pull request unmergeable. Please resolve the merge conflicts. |
Fixes #13883
changelog: [
manual_assert
]: don't lint onif cfg!(..) { panic!(..) }