mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-14 17:07:17 +00:00
38d4ac7cea
Discussion previously happened in https://github.com/rust-lang/rust/pull/43498
28 lines
1.3 KiB
Text
28 lines
1.3 KiB
Text
error: this pattern takes a reference on something that is being de-referenced
|
|
--> $DIR/needless_borrowed_ref.rs:5:34
|
|
|
|
|
LL | let _ = v.iter_mut().filter(|&ref a| a.is_empty());
|
|
| ^^^^^^ help: try removing the `&ref` part and just keep: `a`
|
|
|
|
|
= note: `-D clippy::needless-borrowed-reference` implied by `-D warnings`
|
|
|
|
error: this pattern takes a reference on something that is being de-referenced
|
|
--> $DIR/needless_borrowed_ref.rs:10:17
|
|
|
|
|
LL | if let Some(&ref v) = thingy {
|
|
| ^^^^^^ help: try removing the `&ref` part and just keep: `v`
|
|
|
|
error: this pattern takes a reference on something that is being de-referenced
|
|
--> $DIR/needless_borrowed_ref.rs:39:27
|
|
|
|
|
LL | (&Animal::Cat(v), &ref k) | (&ref k, &Animal::Cat(v)) => (), // lifetime mismatch error if there is no '&ref'
|
|
| ^^^^^^ help: try removing the `&ref` part and just keep: `k`
|
|
|
|
error: this pattern takes a reference on something that is being de-referenced
|
|
--> $DIR/needless_borrowed_ref.rs:39:38
|
|
|
|
|
LL | (&Animal::Cat(v), &ref k) | (&ref k, &Animal::Cat(v)) => (), // lifetime mismatch error if there is no '&ref'
|
|
| ^^^^^^ help: try removing the `&ref` part and just keep: `k`
|
|
|
|
error: aborting due to 4 previous errors
|
|
|