-
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
New lint to detect &std::path::MAIN_SEPARATOR.to_string()
#10483
Conversation
r? @flip1995 (rustbot has picked a reviewer for you, use r? to override) |
r? @llogiq |
ec11bb6
to
81a4f6b
Compare
I wonder if we could extend the |
It depends on the existence of a |
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.
Ah, I hadn't noticed the difference here.
I'd like to see some more tests, otherwise this looks good.
|
||
use std::path::MAIN_SEPARATOR; | ||
|
||
fn main() { |
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.
What about let
s without a given type? Or other expressions that are not direct local bindings?
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.
I have added new tests, such as initializing a struct
field with this expression or passing it as a function argument.
I've also made it work when it is a method receiver (see the test with encode_utf16()
), without an explicit &
.
81a4f6b
to
fc4847c
Compare
@llogiq Is there anything more you'd like me to do on this one? |
☔ The latest upstream changes (presumably #10481) made this pull request unmergeable. Please resolve the merge conflicts. |
fc4847c
to
ffabdab
Compare
Thank you! @bors r+ |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
1 similar comment
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
Fixes #10480
changelog: [
manual_main_separator_str
] new lint