rust/tests/ui/needless_borrow_pat.stderr

113 lines
2.7 KiB
Plaintext
Raw Normal View History

error: this pattern creates a reference to a reference
2021-10-23 07:42:52 +00:00
--> $DIR/needless_borrow_pat.rs:59:14
|
LL | Some(ref x) => x,
| ^^^^^ help: try this: `x`
|
= note: `-D clippy::needless-borrow` implied by `-D warnings`
error: this pattern creates a reference to a reference
2021-10-23 07:42:52 +00:00
--> $DIR/needless_borrow_pat.rs:65:14
|
LL | Some(ref x) => *x,
| ^^^^^
|
help: try this
|
LL | Some(x) => x,
2021-08-11 14:21:33 +00:00
| ~ ~
error: this pattern creates a reference to a reference
2021-10-23 07:42:52 +00:00
--> $DIR/needless_borrow_pat.rs:71:14
|
LL | Some(ref x) => {
| ^^^^^
|
help: try this
|
2021-08-11 14:21:33 +00:00
LL ~ Some(x) => {
LL | f1(x);
2021-08-11 14:21:33 +00:00
LL ~ f1(x);
|
error: this pattern creates a reference to a reference
2021-10-23 07:42:52 +00:00
--> $DIR/needless_borrow_pat.rs:81:14
|
LL | Some(ref x) => m1!(x),
| ^^^^^ help: try this: `x`
error: this pattern creates a reference to a reference
2021-10-23 07:42:52 +00:00
--> $DIR/needless_borrow_pat.rs:86:15
|
LL | let _ = |&ref x: &&String| {
| ^^^^^ help: try this: `x`
error: this pattern creates a reference to a reference
2021-10-23 07:42:52 +00:00
--> $DIR/needless_borrow_pat.rs:91:10
|
LL | let (ref y,) = (&x,);
| ^^^^^
|
help: try this
|
2021-08-11 14:21:33 +00:00
LL ~ let (y,) = (&x,);
LL ~ let _: &String = y;
|
error: this pattern creates a reference to a reference
2021-10-23 07:42:52 +00:00
--> $DIR/needless_borrow_pat.rs:101:14
|
LL | Some(ref x) => x.0,
| ^^^^^ help: try this: `x`
error: this pattern creates a reference to a reference
2021-10-23 07:42:52 +00:00
--> $DIR/needless_borrow_pat.rs:111:14
|
LL | E::A(ref x) | E::B(ref x) => *x,
| ^^^^^ ^^^^^
|
help: try this
|
LL | E::A(x) | E::B(x) => x,
2021-08-11 14:21:33 +00:00
| ~ ~ ~
error: this pattern creates a reference to a reference
2021-10-23 07:42:52 +00:00
--> $DIR/needless_borrow_pat.rs:117:21
|
LL | if let Some(ref x) = Some(&String::new());
| ^^^^^ help: try this: `x`
error: this pattern creates a reference to a reference
2021-10-23 07:42:52 +00:00
--> $DIR/needless_borrow_pat.rs:125:12
|
LL | fn f2<'a>(&ref x: &&'a String) -> &'a String {
| ^^^^^
|
help: try this
|
2021-08-11 14:21:33 +00:00
LL ~ fn f2<'a>(&x: &&'a String) -> &'a String {
LL | let _: &String = x;
2021-08-11 14:21:33 +00:00
LL ~ x
|
error: this pattern creates a reference to a reference
2021-10-23 07:42:52 +00:00
--> $DIR/needless_borrow_pat.rs:132:11
|
LL | fn f(&ref x: &&String) {
| ^^^^^ help: try this: `x`
error: this pattern creates a reference to a reference
2021-10-23 07:42:52 +00:00
--> $DIR/needless_borrow_pat.rs:140:11
|
LL | fn f(&ref x: &&String) {
| ^^^^^
|
help: try this
|
2021-08-11 14:21:33 +00:00
LL ~ fn f(&x: &&String) {
LL ~ let _: &String = x;
|
error: aborting due to 12 previous errors