-
Notifications
You must be signed in to change notification settings - Fork 1.7k
used_underscore can't handle macros and derive properly at the same time #507
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
Comments
I can take a look at this tonight. While we are improving the macro checking, we might want to lint in cases like this:
(currently we don't lint that) |
We don't want to lint in that case. The exact example is obvious, but it's possible that with a more complex macro that the unused variable was due to the exact set of arguments passed which may have deliberately made it unused. |
Make `used_underscore_binding` lint compatible with MacroAttributes expansions. TODO: Add a good test for this.
I wrote something that I think would work, but I'm not sure how best to test this. I don't want to test using |
(Ah, sorry, didn't see this message) Eh, rustc-serialize is stable (since the derive functionality is part of the compiler in this case), so I'm okay with a dev-dependency on it. We already do this for regex for a different macro test. |
I removed the test in Manishearth@4a32445 because we need a stronger macro check to handle stuff like https://github.com/Manishearth/rust-clippy/issues/488#issuecomment-166032639
Might need to write a better macro check. Looks like hygiene works differently for
MacroAttribute
s. Perhaps we should just check for those?cc @devonhollowood
The text was updated successfully, but these errors were encountered: