Add new lint: manual_assert_matches - #17118
Conversation
|
Lintcheck changes for 89f7a41
This comment will be updated if you push new changes |
There was a problem hiding this comment.
I am not sure you need an early collector pass.
When you check an expression, if it comes from expansion, you can use first_node_macro_backtrace() from clippy_utils::macros to get the succession of macro calls. You can then match them against one of the *assert! macros (see is_assert_macro()), then against matches!() (by checking it is the right diagnostic item). This is much more robust than comparing strings.
|
Reminder, once the PR becomes ready for a review, use |
|
Thank you @samueltardieu! |
This comment has been minimized.
This comment has been minimized.
4de4469 to
17bd309
Compare
|
@rustbot ready |
|
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @samueltardieu (or someone else) some time within the next two weeks. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
43b81cc to
d708cdf
Compare
This comment has been minimized.
This comment has been minimized.
d708cdf to
0522992
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
This comment has been minimized.
This comment has been minimized.
af2c00f to
ea37ee5
Compare
This comment has been minimized.
This comment has been minimized.
b628ebb to
89f7a41
Compare
|
☔ The latest upstream changes (possibly #15000) made this pull request unmergeable. Please resolve the merge conflicts. |
Close #17111
changelog: [
manual_assert_matches]: Add new lint:manual_assert_matches