2022-10-06 07:44:38 +00:00
|
|
|
error: this pattern takes a reference on something that is being dereferenced
|
2023-08-24 19:32:12 +00:00
|
|
|
--> $DIR/needless_borrowed_ref.rs:30:34
|
2018-10-06 16:18:06 +00:00
|
|
|
|
|
2018-12-27 15:57:55 +00:00
|
|
|
LL | let _ = v.iter_mut().filter(|&ref a| a.is_empty());
|
2022-10-06 07:44:38 +00:00
|
|
|
| ^^^^^^
|
2018-10-06 16:18:06 +00:00
|
|
|
|
|
|
|
|
= note: `-D clippy::needless-borrowed-reference` implied by `-D warnings`
|
2023-08-01 12:02:21 +00:00
|
|
|
= help: to override `-D warnings` add `#[allow(clippy::needless_borrowed_reference)]`
|
2022-10-06 07:44:38 +00:00
|
|
|
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
|
2023-08-24 19:32:12 +00:00
|
|
|
--> $DIR/needless_borrowed_ref.rs:34:17
|
2022-10-06 07:44:38 +00:00
|
|
|
|
|
|
|
|
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
|
2023-08-24 19:32:12 +00:00
|
|
|
--> $DIR/needless_borrowed_ref.rs:36:14
|
2022-10-06 07:44:38 +00:00
|
|
|
|
|
|
|
|
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
|
2023-08-24 19:32:12 +00:00
|
|
|
--> $DIR/needless_borrowed_ref.rs:38:9
|
2022-10-06 07:44:38 +00:00
|
|
|
|
|
|
|
|
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
|
2023-08-24 19:32:12 +00:00
|
|
|
--> $DIR/needless_borrowed_ref.rs:39:9
|
2022-10-06 07:44:38 +00:00
|
|
|
|
|
|
|
|
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
|
2023-08-24 19:32:12 +00:00
|
|
|
--> $DIR/needless_borrowed_ref.rs:41:12
|
2022-10-06 07:44:38 +00:00
|
|
|
|
|
|
|
|
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
|
2023-08-24 19:32:12 +00:00
|
|
|
--> $DIR/needless_borrowed_ref.rs:42:12
|
2022-10-06 07:44:38 +00:00
|
|
|
|
|
|
|
|
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
|
2023-08-24 19:32:12 +00:00
|
|
|
--> $DIR/needless_borrowed_ref.rs:44:12
|
2022-10-06 07:44:38 +00:00
|
|
|
|
|
|
|
|
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
|
2023-08-24 19:32:12 +00:00
|
|
|
--> $DIR/needless_borrowed_ref.rs:45:12
|
2022-10-06 07:44:38 +00:00
|
|
|
|
|
|
|
|
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
|
2023-08-24 19:32:12 +00:00
|
|
|
--> $DIR/needless_borrowed_ref.rs:46:12
|
2022-10-06 07:44:38 +00:00
|
|
|
|
|
|
|
|
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 {}
|
|
|
|
|
|
2017-07-01 10:02:00 +00:00
|
|
|
|
2022-11-21 19:34:47 +00:00
|
|
|
error: dereferencing a slice pattern where every element takes a reference
|
2023-08-24 19:32:12 +00:00
|
|
|
--> $DIR/needless_borrowed_ref.rs:48:12
|
2022-11-21 19:34:47 +00:00
|
|
|
|
|
|
|
|
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
|
2023-08-24 19:32:12 +00:00
|
|
|
--> $DIR/needless_borrowed_ref.rs:50:12
|
2022-11-21 19:34:47 +00:00
|
|
|
|
|
|
|
|
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
|
2023-08-24 19:32:12 +00:00
|
|
|
--> $DIR/needless_borrowed_ref.rs:51:12
|
2022-11-21 19:34:47 +00:00
|
|
|
|
|
|
|
|
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
|
2023-08-24 19:32:12 +00:00
|
|
|
--> $DIR/needless_borrowed_ref.rs:52:12
|
2022-11-21 19:34:47 +00:00
|
|
|
|
|
|
|
|
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
|
2023-08-24 19:32:12 +00:00
|
|
|
--> $DIR/needless_borrowed_ref.rs:54:12
|
2022-11-21 19:34:47 +00:00
|
|
|
|
|
|
|
|
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
|
2023-08-24 19:32:12 +00:00
|
|
|
--> $DIR/needless_borrowed_ref.rs:56:12
|
2022-11-21 19:34:47 +00:00
|
|
|
|
|
|
|
|
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
|
2023-08-24 19:32:12 +00:00
|
|
|
--> $DIR/needless_borrowed_ref.rs:63:12
|
2022-11-21 19:34:47 +00:00
|
|
|
|
|
|
|
|
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
|
2018-01-16 16:06:27 +00:00
|
|
|
|