mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-12-23 19:43:20 +00:00
214 lines
6 KiB
Text
214 lines
6 KiB
Text
error: this pattern takes a reference on something that is being dereferenced
|
|
--> $DIR/needless_borrowed_ref.rs:32:34
|
|
|
|
|
LL | let _ = v.iter_mut().filter(|&ref a| a.is_empty());
|
|
| ^^^^^^
|
|
|
|
|
= note: `-D clippy::needless-borrowed-reference` implied by `-D warnings`
|
|
help: try removing the `&ref` part
|
|
|
|
|
LL - let _ = v.iter_mut().filter(|&ref a| a.is_empty());
|
|
LL + let _ = v.iter_mut().filter(|a| a.is_empty());
|
|
|
|
|
|
|
error: this pattern takes a reference on something that is being dereferenced
|
|
--> $DIR/needless_borrowed_ref.rs:36:17
|
|
|
|
|
LL | if let Some(&ref v) = thingy {}
|
|
| ^^^^^^
|
|
|
|
|
help: try removing the `&ref` part
|
|
|
|
|
LL - if let Some(&ref v) = thingy {}
|
|
LL + if let Some(v) = thingy {}
|
|
|
|
|
|
|
error: this pattern takes a reference on something that is being dereferenced
|
|
--> $DIR/needless_borrowed_ref.rs:38:14
|
|
|
|
|
LL | if let &[&ref a, ref b] = slice_of_refs {}
|
|
| ^^^^^^
|
|
|
|
|
help: try removing the `&ref` part
|
|
|
|
|
LL - if let &[&ref a, ref b] = slice_of_refs {}
|
|
LL + if let &[a, ref b] = slice_of_refs {}
|
|
|
|
|
|
|
error: dereferencing a slice pattern where every element takes a reference
|
|
--> $DIR/needless_borrowed_ref.rs:40:9
|
|
|
|
|
LL | let &[ref a, ..] = &array;
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
help: try removing the `&` and `ref` parts
|
|
|
|
|
LL - let &[ref a, ..] = &array;
|
|
LL + let [a, ..] = &array;
|
|
|
|
|
|
|
error: dereferencing a slice pattern where every element takes a reference
|
|
--> $DIR/needless_borrowed_ref.rs:41:9
|
|
|
|
|
LL | let &[ref a, ref b, ..] = &array;
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: try removing the `&` and `ref` parts
|
|
|
|
|
LL - let &[ref a, ref b, ..] = &array;
|
|
LL + let [a, b, ..] = &array;
|
|
|
|
|
|
|
error: dereferencing a slice pattern where every element takes a reference
|
|
--> $DIR/needless_borrowed_ref.rs:43:12
|
|
|
|
|
LL | if let &[ref a, ref b] = slice {}
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
help: try removing the `&` and `ref` parts
|
|
|
|
|
LL - if let &[ref a, ref b] = slice {}
|
|
LL + if let [a, b] = slice {}
|
|
|
|
|
|
|
error: dereferencing a slice pattern where every element takes a reference
|
|
--> $DIR/needless_borrowed_ref.rs:44:12
|
|
|
|
|
LL | if let &[ref a, ref b] = &vec[..] {}
|
|
| ^^^^^^^^^^^^^^^
|
|
|
|
|
help: try removing the `&` and `ref` parts
|
|
|
|
|
LL - if let &[ref a, ref b] = &vec[..] {}
|
|
LL + if let [a, b] = &vec[..] {}
|
|
|
|
|
|
|
error: dereferencing a slice pattern where every element takes a reference
|
|
--> $DIR/needless_borrowed_ref.rs:46:12
|
|
|
|
|
LL | if let &[ref a, ref b, ..] = slice {}
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: try removing the `&` and `ref` parts
|
|
|
|
|
LL - if let &[ref a, ref b, ..] = slice {}
|
|
LL + if let [a, b, ..] = slice {}
|
|
|
|
|
|
|
error: dereferencing a slice pattern where every element takes a reference
|
|
--> $DIR/needless_borrowed_ref.rs:47:12
|
|
|
|
|
LL | if let &[ref a, .., ref b] = slice {}
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: try removing the `&` and `ref` parts
|
|
|
|
|
LL - if let &[ref a, .., ref b] = slice {}
|
|
LL + if let [a, .., b] = slice {}
|
|
|
|
|
|
|
error: dereferencing a slice pattern where every element takes a reference
|
|
--> $DIR/needless_borrowed_ref.rs:48:12
|
|
|
|
|
LL | if let &[.., ref a, ref b] = slice {}
|
|
| ^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: try removing the `&` and `ref` parts
|
|
|
|
|
LL - if let &[.., ref a, ref b] = slice {}
|
|
LL + if let [.., a, b] = slice {}
|
|
|
|
|
|
|
error: dereferencing a slice pattern where every element takes a reference
|
|
--> $DIR/needless_borrowed_ref.rs:50:12
|
|
|
|
|
LL | if let &[ref a, _] = slice {}
|
|
| ^^^^^^^^^^^
|
|
|
|
|
help: try removing the `&` and `ref` parts
|
|
|
|
|
LL - if let &[ref a, _] = slice {}
|
|
LL + if let [a, _] = slice {}
|
|
|
|
|
|
|
error: dereferencing a tuple pattern where every element takes a reference
|
|
--> $DIR/needless_borrowed_ref.rs:52:12
|
|
|
|
|
LL | if let &(ref a, ref b, ref c) = &tuple {}
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: try removing the `&` and `ref` parts
|
|
|
|
|
LL - if let &(ref a, ref b, ref c) = &tuple {}
|
|
LL + if let (a, b, c) = &tuple {}
|
|
|
|
|
|
|
error: dereferencing a tuple pattern where every element takes a reference
|
|
--> $DIR/needless_borrowed_ref.rs:53:12
|
|
|
|
|
LL | if let &(ref a, _, ref c) = &tuple {}
|
|
| ^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: try removing the `&` and `ref` parts
|
|
|
|
|
LL - if let &(ref a, _, ref c) = &tuple {}
|
|
LL + if let (a, _, c) = &tuple {}
|
|
|
|
|
|
|
error: dereferencing a tuple pattern where every element takes a reference
|
|
--> $DIR/needless_borrowed_ref.rs:54:12
|
|
|
|
|
LL | if let &(ref a, ..) = &tuple {}
|
|
| ^^^^^^^^^^^^
|
|
|
|
|
help: try removing the `&` and `ref` parts
|
|
|
|
|
LL - if let &(ref a, ..) = &tuple {}
|
|
LL + if let (a, ..) = &tuple {}
|
|
|
|
|
|
|
error: dereferencing a tuple pattern where every element takes a reference
|
|
--> $DIR/needless_borrowed_ref.rs:56:12
|
|
|
|
|
LL | if let &TupleStruct(ref a, ..) = &tuple_struct {}
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: try removing the `&` and `ref` parts
|
|
|
|
|
LL - if let &TupleStruct(ref a, ..) = &tuple_struct {}
|
|
LL + if let TupleStruct(a, ..) = &tuple_struct {}
|
|
|
|
|
|
|
error: dereferencing a struct pattern where every field's pattern takes a reference
|
|
--> $DIR/needless_borrowed_ref.rs:58:12
|
|
|
|
|
LL | if let &Struct {
|
|
| ____________^
|
|
LL | | ref a,
|
|
LL | | b: ref b,
|
|
LL | | c: ref renamed,
|
|
LL | | } = &s
|
|
| |_____^
|
|
|
|
|
help: try removing the `&` and `ref` parts
|
|
|
|
|
LL ~ if let Struct {
|
|
LL ~ a,
|
|
LL ~ b: b,
|
|
LL ~ c: renamed,
|
|
|
|
|
|
|
error: dereferencing a struct pattern where every field's pattern takes a reference
|
|
--> $DIR/needless_borrowed_ref.rs:65:12
|
|
|
|
|
LL | if let &Struct { ref a, b: _, .. } = &s {}
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
help: try removing the `&` and `ref` parts
|
|
|
|
|
LL - if let &Struct { ref a, b: _, .. } = &s {}
|
|
LL + if let Struct { a, b: _, .. } = &s {}
|
|
|
|
|
|
|
error: aborting due to 17 previous errors
|
|
|