-
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
Fix explicit_counter_loop
suggestion
#3901
Conversation
Thanks for the contribution and welcome to Clippy! This LGTM. For suggestions we use the function: rust-clippy/clippy_lints/src/utils/diagnostics.rs Lines 169 to 177 in 61aa5c9
You have to split up the error message into the message and the suggestion. PS: The currently failing CI is unrelated: #3897 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM now.
Since the CI/Clippy master is currently broken, could you check if you have to run rustfmt
?
Otherwise, just the additional test case should be added and this can be merged.
I runned |
All good, just wanted to remind you, so that I can just merge this and don't have to bother you, once Clippy builds again. |
explicit_counter_loop
suggestionexplicit_counter_loop
suggestion
@bors r=flip1995 |
📌 Commit 2b82c71 has been approved by |
Fix `explicit_counter_loop` suggestion #1670 This code seems to me to work, but I have two question. * Because range expression desugared in hir, `Sugg::hir` doesn't add parenthesis to range expression. Which function is better to check range do you think, `check_for_loop_explicit_counter` or `hir_from_snippet`? * Do you think we need to distinguish between range expression and struct expression that creates `std::ops::Range*`?
☀️ Test successful - checks-travis, status-appveyor |
#1670
This code seems to me to work, but I have two question.
Sugg::hir
doesn't add parenthesis to range expression. Which function is better to check range do you think,check_for_loop_explicit_counter
orhir_from_snippet
?std::ops::Range*
?