-
Notifications
You must be signed in to change notification settings - Fork 1.6k
False positive for redundant field names when using range? #2799
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Hi! As far as I can tell, it looks like #2507 tried to address the issue. But I can still reproduce it in the Rust playground (tools -> clippy): I wonder which version includes the PR... |
I can reproduce this locally with Clippy 0.0.198. |
Latest clippy (v0.0.204) does not lint https://play.rust-lang.org/?gist=3cbade6f25fd49565712e71d0a32de78&version=stable&mode=debug |
It seems that A possible (easy) solution would be to just ignore |
I think this is a compiler bug. When lowering expressions in the compiler, it looks like they go to a lot of trouble to set up a span with the correct context and then they replace it if it's enclosed in a parenthesis. See this branch and this branch in |
Fixed by #3007. |
There should be a test for this, before closing this issue. |
Unless I'm mistaken... There are already tests. The errors were fixed by the commit I referenced. |
These tests are for the unparenthesized case. The bug in this issue is that it didn't work with |
OK, I'll submit the PR after the build issues are sorted out. |
Add a test to ensure that #2799 is fixed
For the following code:
Clippy warns:
Is this a legitimate lint?
The text was updated successfully, but these errors were encountered: