-
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
range_plus_one help suggestion should not remove braces #3103
Comments
I would love to take this one! :) And also a question - the correct version should be |
Great! It's all yours. Yes exactly. If you have more question, we're happy to answer! |
One issue that I'm facing is while running I'm running latest: I'm wondering, what I forgot to do? |
TL;DR: rustc nightly is not bleeding edge enough Yeah this is because the Clippy master branch should always compile with the current rustc master and not the nightly, because new nightlies are blocked if Clippy fails to compile. We're currently trying to get Travis and Appveyor to use the rustc master: #2941 Enough with the background info, what do you have to do: rustup-toolchain-install-master -f -n master and compile Clippy with |
Sorry for disturbing again but I dug deeper and got confused. |
Sure thing! If you want to find what is wrong with a lint, the first step is usually to look at the code, which generates the lint. (In this case search for Look especially at Maybe you could also use this function: |
Yes, i saw that |
Sorry I misunderstood you then. You're right, the parentheses should only be added if the expression |
Alright, so I managed fix it for the current issue using |
I didn't thought of this case. You can't differ between
You have two options:
If you want you can also implement the first option for now and leave the second option open. |
The following code triggers the
range_plus_one
lint correctly. However the suggestion, if applied explicitly ie by an IDE, removes the braces which causes a compile error.Incorrect suggested code:
The text was updated successfully, but these errors were encountered: