|
1 | 1 | error: this expression creates a reference which is immediately dereferenced by the compiler |
2 | | - --> $DIR/needless_borrow.rs:9:15 |
| 2 | + --> $DIR/needless_borrow.rs:11:15 |
3 | 3 | | |
4 | 4 | LL | let _ = x(&&a); // warn |
5 | 5 | | ^^^ help: change this to: `&a` |
6 | 6 | | |
7 | 7 | = note: `-D clippy::needless-borrow` implied by `-D warnings` |
8 | 8 |
|
9 | 9 | error: this expression creates a reference which is immediately dereferenced by the compiler |
10 | | - --> $DIR/needless_borrow.rs:13:13 |
| 10 | + --> $DIR/needless_borrow.rs:15:13 |
11 | 11 | | |
12 | 12 | LL | mut_ref(&mut &mut b); // warn |
13 | 13 | | ^^^^^^^^^^^ help: change this to: `&mut b` |
14 | 14 |
|
15 | 15 | error: this expression creates a reference which is immediately dereferenced by the compiler |
16 | | - --> $DIR/needless_borrow.rs:25:13 |
| 16 | + --> $DIR/needless_borrow.rs:27:13 |
17 | 17 | | |
18 | 18 | LL | &&a |
19 | 19 | | ^^^ help: change this to: `&a` |
20 | 20 |
|
21 | 21 | error: this expression creates a reference which is immediately dereferenced by the compiler |
22 | | - --> $DIR/needless_borrow.rs:27:15 |
| 22 | + --> $DIR/needless_borrow.rs:29:15 |
23 | 23 | | |
24 | 24 | LL | 46 => &&a, |
25 | 25 | | ^^^ help: change this to: `&a` |
26 | 26 |
|
27 | 27 | error: this expression creates a reference which is immediately dereferenced by the compiler |
28 | | - --> $DIR/needless_borrow.rs:33:27 |
| 28 | + --> $DIR/needless_borrow.rs:35:27 |
29 | 29 | | |
30 | 30 | LL | break &ref_a; |
31 | 31 | | ^^^^^^ help: change this to: `ref_a` |
32 | 32 |
|
33 | 33 | error: this expression creates a reference which is immediately dereferenced by the compiler |
34 | | - --> $DIR/needless_borrow.rs:40:15 |
| 34 | + --> $DIR/needless_borrow.rs:42:15 |
35 | 35 | | |
36 | 36 | LL | let _ = x(&&&a); |
37 | 37 | | ^^^^ help: change this to: `&a` |
38 | 38 |
|
39 | 39 | error: this expression creates a reference which is immediately dereferenced by the compiler |
40 | | - --> $DIR/needless_borrow.rs:41:15 |
| 40 | + --> $DIR/needless_borrow.rs:43:15 |
41 | 41 | | |
42 | 42 | LL | let _ = x(&mut &&a); |
43 | 43 | | ^^^^^^^^ help: change this to: `&a` |
44 | 44 |
|
45 | 45 | error: this expression creates a reference which is immediately dereferenced by the compiler |
46 | | - --> $DIR/needless_borrow.rs:42:15 |
| 46 | + --> $DIR/needless_borrow.rs:44:15 |
47 | 47 | | |
48 | 48 | LL | let _ = x(&&&mut b); |
49 | 49 | | ^^^^^^^^ help: change this to: `&mut b` |
50 | 50 |
|
51 | 51 | error: this expression creates a reference which is immediately dereferenced by the compiler |
52 | | - --> $DIR/needless_borrow.rs:43:15 |
| 52 | + --> $DIR/needless_borrow.rs:45:15 |
53 | 53 | | |
54 | 54 | LL | let _ = x(&&ref_a); |
55 | 55 | | ^^^^^^^ help: change this to: `ref_a` |
56 | 56 |
|
57 | 57 | error: this expression creates a reference which is immediately dereferenced by the compiler |
58 | | - --> $DIR/needless_borrow.rs:46:11 |
| 58 | + --> $DIR/needless_borrow.rs:48:11 |
59 | 59 | | |
60 | 60 | LL | x(&b); |
61 | 61 | | ^^ help: change this to: `b` |
62 | 62 |
|
63 | 63 | error: this expression creates a reference which is immediately dereferenced by the compiler |
64 | | - --> $DIR/needless_borrow.rs:53:13 |
| 64 | + --> $DIR/needless_borrow.rs:55:13 |
65 | 65 | | |
66 | 66 | LL | mut_ref(&mut x); |
67 | 67 | | ^^^^^^ help: change this to: `x` |
68 | 68 |
|
69 | 69 | error: this expression creates a reference which is immediately dereferenced by the compiler |
70 | | - --> $DIR/needless_borrow.rs:54:13 |
| 70 | + --> $DIR/needless_borrow.rs:56:13 |
71 | 71 | | |
72 | 72 | LL | mut_ref(&mut &mut x); |
73 | 73 | | ^^^^^^^^^^^ help: change this to: `x` |
74 | 74 |
|
75 | 75 | error: this expression creates a reference which is immediately dereferenced by the compiler |
76 | | - --> $DIR/needless_borrow.rs:55:23 |
| 76 | + --> $DIR/needless_borrow.rs:57:23 |
77 | 77 | | |
78 | 78 | LL | let y: &mut i32 = &mut x; |
79 | 79 | | ^^^^^^ help: change this to: `x` |
80 | 80 |
|
81 | 81 | error: this expression creates a reference which is immediately dereferenced by the compiler |
82 | | - --> $DIR/needless_borrow.rs:56:23 |
| 82 | + --> $DIR/needless_borrow.rs:58:23 |
83 | 83 | | |
84 | 84 | LL | let y: &mut i32 = &mut &mut x; |
85 | 85 | | ^^^^^^^^^^^ help: change this to: `x` |
86 | 86 |
|
87 | 87 | error: this expression borrows a value the compiler would automatically borrow |
88 | | - --> $DIR/needless_borrow.rs:72:13 |
| 88 | + --> $DIR/needless_borrow.rs:74:13 |
89 | 89 | | |
90 | 90 | LL | let _ = (&x).0; |
91 | 91 | | ^^^^ help: change this to: `x` |
92 | 92 |
|
93 | 93 | error: this expression borrows a value the compiler would automatically borrow |
94 | | - --> $DIR/needless_borrow.rs:74:22 |
| 94 | + --> $DIR/needless_borrow.rs:76:22 |
95 | 95 | | |
96 | 96 | LL | let _ = unsafe { (&*x).0 }; |
97 | 97 | | ^^^^^ help: change this to: `(*x)` |
|
0 commit comments