11error: this pattern creates a reference to a reference
2- --> $DIR/needless_borrow_pat.rs:48 :14
2+ --> $DIR/needless_borrow_pat.rs:43 :14
33 |
44LL | Some(ref x) => x,
55 | ^^^^^ help: try this: `x`
66 |
77 = note: `-D clippy::needless-borrow` implied by `-D warnings`
88
99error: this pattern creates a reference to a reference
10- --> $DIR/needless_borrow_pat.rs:54 :14
10+ --> $DIR/needless_borrow_pat.rs:49 :14
1111 |
1212LL | Some(ref x) => *x,
1313 | ^^^^^
@@ -18,18 +18,7 @@ LL | Some(x) => x,
1818 | ^ ^
1919
2020error: this pattern creates a reference to a reference
21- --> $DIR/needless_borrow_pat.rs:60:14
22- |
23- LL | Some(ref x) => x,
24- | ^^^^^
25- |
26- help: try this
27- |
28- LL | Some(x) => &x,
29- | ^ ^^
30-
31- error: this pattern creates a reference to a reference
32- --> $DIR/needless_borrow_pat.rs:66:14
21+ --> $DIR/needless_borrow_pat.rs:55:14
3322 |
3423LL | Some(ref x) => {
3524 | ^^^^^
@@ -39,46 +28,22 @@ help: try this
3928LL | Some(x) => {
4029LL | f1(x);
4130LL | f1(x);
42- LL | &x
4331 |
4432
4533error: this pattern creates a reference to a reference
46- --> $DIR/needless_borrow_pat.rs:76 :14
34+ --> $DIR/needless_borrow_pat.rs:65 :14
4735 |
4836LL | Some(ref x) => m1!(x),
4937 | ^^^^^ help: try this: `x`
5038
5139error: this pattern creates a reference to a reference
52- --> $DIR/needless_borrow_pat.rs:82:14
53- |
54- LL | Some(ref x) => m2!(x),
55- | ^^^^^
56- |
57- help: try this
58- |
59- LL | Some(x) => m2!(&x),
60- | ^ ^^
61-
62- error: this pattern creates a reference to a reference
63- --> $DIR/needless_borrow_pat.rs:87:15
40+ --> $DIR/needless_borrow_pat.rs:70:15
6441 |
6542LL | let _ = |&ref x: &&String| {
6643 | ^^^^^ help: try this: `x`
6744
6845error: this pattern creates a reference to a reference
69- --> $DIR/needless_borrow_pat.rs:91:15
70- |
71- LL | let _ = |&ref x: &&String| {
72- | ^^^^^
73- |
74- help: try this
75- |
76- LL | let _ = |&x: &&String| {
77- LL | let _: &&String = &x;
78- |
79-
80- error: this pattern creates a reference to a reference
81- --> $DIR/needless_borrow_pat.rs:96:10
46+ --> $DIR/needless_borrow_pat.rs:75:10
8247 |
8348LL | let (ref y,) = (&x,);
8449 | ^^^^^
@@ -90,26 +55,26 @@ LL | let _: &String = y;
9055 |
9156
9257error: this pattern creates a reference to a reference
93- --> $DIR/needless_borrow_pat.rs:105 :12
58+ --> $DIR/needless_borrow_pat.rs:84 :12
9459 |
9560LL | fn f2<'a>(&ref x: &&'a String) -> &'a String {
9661 | ^^^^^
9762 |
9863help: try this
9964 |
10065LL | fn f2<'a>(&x: &&'a String) -> &'a String {
101- LL | let _: && String = & x;
66+ LL | let _: &String = x;
10267LL | x
10368 |
10469
10570error: this pattern creates a reference to a reference
106- --> $DIR/needless_borrow_pat.rs:112 :11
71+ --> $DIR/needless_borrow_pat.rs:91 :11
10772 |
10873LL | fn f(&ref x: &&String) {
10974 | ^^^^^ help: try this: `x`
11075
11176error: this pattern creates a reference to a reference
112- --> $DIR/needless_borrow_pat.rs:120 :11
77+ --> $DIR/needless_borrow_pat.rs:99 :11
11378 |
11479LL | fn f(&ref x: &&String) {
11580 | ^^^^^
@@ -120,5 +85,5 @@ LL | fn f(&x: &&String) {
12085LL | let _: &String = x;
12186 |
12287
123- error: aborting due to 12 previous errors
88+ error: aborting due to 9 previous errors
12489
0 commit comments