@@ -142,74 +142,98 @@ error: function call inside of `unwrap_or`
142
142
LL | None.unwrap_or( unsafe { ptr_to_ref(s) } );
143
143
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| unsafe { ptr_to_ref(s) })`
144
144
145
+ error: use of `unwrap_or` to construct default value
146
+ --> tests/ui/or_fun_call.rs:215:14
147
+ |
148
+ LL | .unwrap_or(String::new());
149
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
150
+
151
+ error: use of `unwrap_or` to construct default value
152
+ --> tests/ui/or_fun_call.rs:229:14
153
+ |
154
+ LL | .unwrap_or(String::new());
155
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
156
+
157
+ error: use of `unwrap_or` to construct default value
158
+ --> tests/ui/or_fun_call.rs:242:14
159
+ |
160
+ LL | .unwrap_or(String::new());
161
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
162
+
163
+ error: use of `unwrap_or` to construct default value
164
+ --> tests/ui/or_fun_call.rs:254:10
165
+ |
166
+ LL | .unwrap_or(String::new());
167
+ | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
168
+
145
169
error: function call inside of `map_or`
146
- --> tests/ui/or_fun_call.rs:276 :25
170
+ --> tests/ui/or_fun_call.rs:280 :25
147
171
|
148
172
LL | let _ = Some(4).map_or(g(), |v| v);
149
173
| ^^^^^^^^^^^^^^^^^^ help: try: `map_or_else(g, |v| v)`
150
174
151
175
error: function call inside of `map_or`
152
- --> tests/ui/or_fun_call.rs:278 :25
176
+ --> tests/ui/or_fun_call.rs:282 :25
153
177
|
154
178
LL | let _ = Some(4).map_or(g(), f);
155
179
| ^^^^^^^^^^^^^^ help: try: `map_or_else(g, f)`
156
180
157
181
error: use of `unwrap_or_else` to construct default value
158
- --> tests/ui/or_fun_call.rs:310 :18
182
+ --> tests/ui/or_fun_call.rs:314 :18
159
183
|
160
184
LL | with_new.unwrap_or_else(Vec::new);
161
185
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
162
186
163
187
error: use of `unwrap_or_else` to construct default value
164
- --> tests/ui/or_fun_call.rs:314 :28
188
+ --> tests/ui/or_fun_call.rs:318 :28
165
189
|
166
190
LL | with_default_trait.unwrap_or_else(Default::default);
167
191
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
168
192
169
193
error: use of `unwrap_or_else` to construct default value
170
- --> tests/ui/or_fun_call.rs:318 :27
194
+ --> tests/ui/or_fun_call.rs:322 :27
171
195
|
172
196
LL | with_default_type.unwrap_or_else(u64::default);
173
197
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
174
198
175
199
error: use of `unwrap_or_else` to construct default value
176
- --> tests/ui/or_fun_call.rs:322 :22
200
+ --> tests/ui/or_fun_call.rs:326 :22
177
201
|
178
202
LL | real_default.unwrap_or_else(<FakeDefault as Default>::default);
179
203
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
180
204
181
205
error: use of `or_insert_with` to construct default value
182
- --> tests/ui/or_fun_call.rs:326 :23
206
+ --> tests/ui/or_fun_call.rs:330 :23
183
207
|
184
208
LL | map.entry(42).or_insert_with(String::new);
185
209
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
186
210
187
211
error: use of `or_insert_with` to construct default value
188
- --> tests/ui/or_fun_call.rs:330 :25
212
+ --> tests/ui/or_fun_call.rs:334 :25
189
213
|
190
214
LL | btree.entry(42).or_insert_with(String::new);
191
215
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
192
216
193
217
error: use of `unwrap_or_else` to construct default value
194
- --> tests/ui/or_fun_call.rs:334 :25
218
+ --> tests/ui/or_fun_call.rs:338 :25
195
219
|
196
220
LL | let _ = stringy.unwrap_or_else(String::new);
197
221
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
198
222
199
223
error: function call inside of `unwrap_or`
200
- --> tests/ui/or_fun_call.rs:376 :17
224
+ --> tests/ui/or_fun_call.rs:380 :17
201
225
|
202
226
LL | let _ = opt.unwrap_or({ f() }); // suggest `.unwrap_or_else(f)`
203
227
| ^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(f)`
204
228
205
229
error: function call inside of `unwrap_or`
206
- --> tests/ui/or_fun_call.rs:381 :17
230
+ --> tests/ui/or_fun_call.rs:385 :17
207
231
|
208
232
LL | let _ = opt.unwrap_or(f() + 1); // suggest `.unwrap_or_else(|| f() + 1)`
209
233
| ^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| f() + 1)`
210
234
211
235
error: function call inside of `unwrap_or`
212
- --> tests/ui/or_fun_call.rs:386 :17
236
+ --> tests/ui/or_fun_call.rs:390 :17
213
237
|
214
238
LL | let _ = opt.unwrap_or({
215
239
| _________________^
@@ -229,22 +253,22 @@ LL ~ });
229
253
|
230
254
231
255
error: function call inside of `map_or`
232
- --> tests/ui/or_fun_call.rs:392 :17
256
+ --> tests/ui/or_fun_call.rs:396 :17
233
257
|
234
258
LL | let _ = opt.map_or(f() + 1, |v| v); // suggest `.map_or_else(|| f() + 1, |v| v)`
235
259
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `map_or_else(|| f() + 1, |v| v)`
236
260
237
261
error: use of `unwrap_or` to construct default value
238
- --> tests/ui/or_fun_call.rs:397 :17
262
+ --> tests/ui/or_fun_call.rs:401 :17
239
263
|
240
264
LL | let _ = opt.unwrap_or({ i32::default() });
241
265
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
242
266
243
267
error: function call inside of `unwrap_or`
244
- --> tests/ui/or_fun_call.rs:404 :21
268
+ --> tests/ui/or_fun_call.rs:408 :21
245
269
|
246
270
LL | let _ = opt_foo.unwrap_or(Foo { val: String::default() });
247
271
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| Foo { val: String::default() })`
248
272
249
- error: aborting due to 38 previous errors
273
+ error: aborting due to 42 previous errors
250
274
0 commit comments