-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Move unimplemented to an EarlyLintPass #4186
Move unimplemented to an EarlyLintPass #4186
Conversation
The You basically just need this part of the rust-clippy/clippy_lints/src/write.rs Line 326 in 01ab9fe
rust-clippy/clippy_lints/src/write.rs Lines 339 to 342 in 01ab9fe
For rust-clippy/clippy_lints/src/panic_unimplemented.rs Lines 87 to 89 in 01ab9fe
This will tell you if there is a After this, you can check if there are parameters with rust-clippy/clippy_lints/src/write.rs Lines 334 to 336 in 01ab9fe
and // You only need to try to parse one expression and not all format parameters
parser.parse_expr().map_err(|mut err| err.cancel()).is_some() You pretty much can put this all together in one |
Did the problem with |
The problem got not fixed and probably won't be fixed.
This is the case here. So it should be fine to turn this into a @maxencefrenette Could you add following test: macro_rules! outer_macro {
($e:expr) => {
$e;
};
}
// ...
outer_macro!(unimplemented!()); This |
Interesting stuff. I'll for sure add that test when I get back to it. Thanks a lot for your help @flip1995 ! |
Well that's bad :( I'm not sure what's the best course of action here is... Let's be naive: Can we use the |
☔ The latest upstream changes (presumably #4251) made this pull request unmergeable. Please resolve the merge conflicts. |
Thanks for the work! But I don't think moving this lint to a pre_expansion_pass is the right thing to do here. Since this is stale for some time, I'm going ahead and close this PR. |
fixes #3528
WIP
Hi all ! As suggested in the issue thread, I moved the
unimplemented
lint to anEarlyLintPass
. It works great and makes the code much simpler. However, I don't know how to move the panic lint to anEarlyLintPass
. I see a couple options right now.check_tts()
function fromclippy_lints/src/write.rs
. However, I couldn't fully grasp how to adapt it to work in this case.