-
Notifications
You must be signed in to change notification settings - Fork 1.6k
fix: redundant_clone
FP in overlapping lifetime
#14237
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
Conversation
r? @Alexendoo rustbot has assigned @Alexendoo. Use |
1f39cb0
to
5853c9d
Compare
r? clippy |
r? clippy |
f2d9b0b
to
f234dc7
Compare
r? clippy |
r? clippy |
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.
The following is a false positive and the suggestion will cause an error:
let mut a = String::new();
let mut b = String::new();
for _ in 1..10 {
b = a.clone();
}
This shows in the lintcheck run.
@rustbot author |
Reminder, once the PR becomes ready for a review, use |
@rustbot ready |
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.
Could you add the test case that would wrongly trigger the lint (the assignment in a loop) so that it can act as a non regression test?
Looks good, thanks! |
fixes #13900
changelog: [
redundant_clone
]: fix FP in overlapping lifetime