-
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
manual_slice_fill
: do not initialize from the iterator
#14191
Conversation
r? @Manishearth rustbot has assigned @Manishearth. Use |
r? clippy |
(ping @lapla-cogito who is the author of this new lint) |
r? clippy Still traveling |
88adc95
to
3b11310
Compare
3b11310
to
7db652c
Compare
Rebased |
In both instances, `!assign_val.span.from_expansion()` – which is more restrictive than `span_is_local(assign_val.span)` – has been required already.
```rust let mut tmp = vec![1, 2, 3]; for b in &mut tmp { *b = !*b; } ``` must not suggest the invalid `tmp.fill(!*b)`.
7db652c
to
44aa75f
Compare
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.
Thanks!
must not suggest the invalid
tmp.fill(!*b)
.In addition, there is another commit which cleans up two function calls with no effect.
Fix #14189
changelog: [
manual_slice_fill
]: ensure that the initialization expression doesn't reference the iterator