@@ -103,71 +103,71 @@ error: this expression borrows a value the compiler would automatically borrow
103
103
LL | let _ = (&x).0;
104
104
| ^^^^ help: change this to: `x`
105
105
106
- error: this expression borrows a value the compiler would automatically borrow
107
- --> tests/ui/needless_borrow.rs:111:22
108
- |
109
- LL | let _ = unsafe { (&*x).0 };
110
- | ^^^^^ help: change this to: `(*x)`
111
-
112
106
error: this expression creates a reference which is immediately dereferenced by the compiler
113
- --> tests/ui/needless_borrow.rs:122 :5
107
+ --> tests/ui/needless_borrow.rs:119 :5
114
108
|
115
109
LL | (&&()).foo();
116
110
| ^^^^^^ help: change this to: `(&())`
117
111
118
112
error: this expression creates a reference which is immediately dereferenced by the compiler
119
- --> tests/ui/needless_borrow.rs:132 :5
113
+ --> tests/ui/needless_borrow.rs:129 :5
120
114
|
121
115
LL | (&&5).foo();
122
116
| ^^^^^ help: change this to: `(&5)`
123
117
124
118
error: this expression creates a reference which is immediately dereferenced by the compiler
125
- --> tests/ui/needless_borrow.rs:159 :23
119
+ --> tests/ui/needless_borrow.rs:156 :23
126
120
|
127
121
LL | let x: (&str,) = (&"",);
128
122
| ^^^ help: change this to: `""`
129
123
130
124
error: this expression borrows a value the compiler would automatically borrow
131
- --> tests/ui/needless_borrow.rs:202 :13
125
+ --> tests/ui/needless_borrow.rs:199 :13
132
126
|
133
127
LL | (&self.f)()
134
128
| ^^^^^^^^^ help: change this to: `(self.f)`
135
129
136
130
error: this expression borrows a value the compiler would automatically borrow
137
- --> tests/ui/needless_borrow.rs:212 :13
131
+ --> tests/ui/needless_borrow.rs:209 :13
138
132
|
139
133
LL | (&mut self.f)()
140
134
| ^^^^^^^^^^^^^ help: change this to: `(self.f)`
141
135
142
136
error: this expression borrows a value the compiler would automatically borrow
143
- --> tests/ui/needless_borrow.rs:250 :22
137
+ --> tests/ui/needless_borrow.rs:247 :22
144
138
|
145
139
LL | let _ = &mut (&mut { x.u }).x;
146
140
| ^^^^^^^^^^^^^^ help: change this to: `{ x.u }`
147
141
148
142
error: this expression borrows a value the compiler would automatically borrow
149
- --> tests/ui/needless_borrow.rs:258 :22
143
+ --> tests/ui/needless_borrow.rs:255 :22
150
144
|
151
145
LL | let _ = &mut (&mut { x.u }).x;
152
146
| ^^^^^^^^^^^^^^ help: change this to: `{ x.u }`
153
147
154
148
error: this expression borrows a value the compiler would automatically borrow
155
- --> tests/ui/needless_borrow.rs:263 :22
149
+ --> tests/ui/needless_borrow.rs:260 :22
156
150
|
157
151
LL | let _ = &mut (&mut x.u).x;
158
152
| ^^^^^^^^^^ help: change this to: `x.u`
159
153
160
154
error: this expression borrows a value the compiler would automatically borrow
161
- --> tests/ui/needless_borrow.rs:265 :22
155
+ --> tests/ui/needless_borrow.rs:262 :22
162
156
|
163
157
LL | let _ = &mut (&mut { x.u }).x;
164
158
| ^^^^^^^^^^^^^^ help: change this to: `{ x.u }`
165
159
166
160
error: this expression creates a reference which is immediately dereferenced by the compiler
167
- --> tests/ui/needless_borrow.rs:287 :23
161
+ --> tests/ui/needless_borrow.rs:284 :23
168
162
|
169
163
LL | option.unwrap_or((&x.0,));
170
164
| ^^^^ help: change this to: `x.0`
171
165
166
+ error: this expression creates a reference which is immediately dereferenced by the compiler
167
+ --> tests/ui/needless_borrow.rs:291:13
168
+ |
169
+ LL | let _ = (&slice).len();
170
+ | ^^^^^^^^ help: change this to: `slice`
171
+
172
172
error: aborting due to 28 previous errors
173
173
0 commit comments