rust/tests/ui/needless_borrowed_ref.stderr

29 lines
1.3 KiB
Plaintext
Raw Normal View History

error: this pattern takes a reference on something that is being de-referenced
2018-12-10 06:27:19 +01:00
--> $DIR/needless_borrowed_ref.rs:14:34
2018-10-06 18:18:06 +02:00
|
2018-12-10 06:27:19 +01:00
14 | let _ = v.iter_mut().filter(|&ref a| a.is_empty());
2018-10-06 18:18:06 +02:00
| ^^^^^^ 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
2018-12-10 06:27:19 +01:00
--> $DIR/needless_borrowed_ref.rs:19:17
|
2018-12-10 06:27:19 +01:00
19 | 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
2018-12-10 06:27:19 +01:00
--> $DIR/needless_borrowed_ref.rs:48:27
|
2018-12-10 06:27:19 +01:00
48 | (&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
2018-12-10 06:27:19 +01:00
--> $DIR/needless_borrowed_ref.rs:48:38
|
2018-12-10 06:27:19 +01:00
48 | (&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`
2018-01-16 17:06:27 +01:00
error: aborting due to 4 previous errors