@@ -154,62 +154,68 @@ error: function call inside of `map_or`
154
154
LL | let _ = Some(4).map_or(g(), f);
155
155
| ^^^^^^^^^^^^^^ help: try: `map_or_else(g, f)`
156
156
157
+ error: function call inside of `map_or`
158
+ --> tests/ui/or_fun_call.rs:286:25
159
+ |
160
+ LL | let _ = Some(4).map_or("asd".to_string().len() as i32, f);
161
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map_or_else(|| "asd".to_string().len() as i32, f)`
162
+
157
163
error: use of `unwrap_or_else` to construct default value
158
- --> tests/ui/or_fun_call.rs:315 :18
164
+ --> tests/ui/or_fun_call.rs:317 :18
159
165
|
160
166
LL | with_new.unwrap_or_else(Vec::new);
161
167
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
162
168
163
169
error: use of `unwrap_or_else` to construct default value
164
- --> tests/ui/or_fun_call.rs:319 :28
170
+ --> tests/ui/or_fun_call.rs:321 :28
165
171
|
166
172
LL | with_default_trait.unwrap_or_else(Default::default);
167
173
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
168
174
169
175
error: use of `unwrap_or_else` to construct default value
170
- --> tests/ui/or_fun_call.rs:323 :27
176
+ --> tests/ui/or_fun_call.rs:325 :27
171
177
|
172
178
LL | with_default_type.unwrap_or_else(u64::default);
173
179
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
174
180
175
181
error: use of `unwrap_or_else` to construct default value
176
- --> tests/ui/or_fun_call.rs:327 :22
182
+ --> tests/ui/or_fun_call.rs:329 :22
177
183
|
178
184
LL | real_default.unwrap_or_else(<FakeDefault as Default>::default);
179
185
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
180
186
181
187
error: use of `or_insert_with` to construct default value
182
- --> tests/ui/or_fun_call.rs:331 :23
188
+ --> tests/ui/or_fun_call.rs:333 :23
183
189
|
184
190
LL | map.entry(42).or_insert_with(String::new);
185
191
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
186
192
187
193
error: use of `or_insert_with` to construct default value
188
- --> tests/ui/or_fun_call.rs:335 :25
194
+ --> tests/ui/or_fun_call.rs:337 :25
189
195
|
190
196
LL | btree.entry(42).or_insert_with(String::new);
191
197
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
192
198
193
199
error: use of `unwrap_or_else` to construct default value
194
- --> tests/ui/or_fun_call.rs:339 :25
200
+ --> tests/ui/or_fun_call.rs:341 :25
195
201
|
196
202
LL | let _ = stringy.unwrap_or_else(String::new);
197
203
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
198
204
199
205
error: function call inside of `unwrap_or`
200
- --> tests/ui/or_fun_call.rs:381 :17
206
+ --> tests/ui/or_fun_call.rs:383 :17
201
207
|
202
208
LL | let _ = opt.unwrap_or({ f() }); // suggest `.unwrap_or_else(f)`
203
209
| ^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(f)`
204
210
205
211
error: function call inside of `unwrap_or`
206
- --> tests/ui/or_fun_call.rs:386 :17
212
+ --> tests/ui/or_fun_call.rs:388 :17
207
213
|
208
214
LL | let _ = opt.unwrap_or(f() + 1); // suggest `.unwrap_or_else(|| f() + 1)`
209
215
| ^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| f() + 1)`
210
216
211
217
error: function call inside of `unwrap_or`
212
- --> tests/ui/or_fun_call.rs:391 :17
218
+ --> tests/ui/or_fun_call.rs:393 :17
213
219
|
214
220
LL | let _ = opt.unwrap_or({
215
221
| _________________^
@@ -229,52 +235,58 @@ LL ~ });
229
235
|
230
236
231
237
error: function call inside of `map_or`
232
- --> tests/ui/or_fun_call.rs:397 :17
238
+ --> tests/ui/or_fun_call.rs:399 :17
233
239
|
234
240
LL | let _ = opt.map_or(f() + 1, |v| v); // suggest `.map_or_else(|| f() + 1, |v| v)`
235
241
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `map_or_else(|| f() + 1, |v| v)`
236
242
237
243
error: use of `unwrap_or` to construct default value
238
- --> tests/ui/or_fun_call.rs:402 :17
244
+ --> tests/ui/or_fun_call.rs:404 :17
239
245
|
240
246
LL | let _ = opt.unwrap_or({ i32::default() });
241
247
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
242
248
243
249
error: function call inside of `unwrap_or`
244
- --> tests/ui/or_fun_call.rs:409 :21
250
+ --> tests/ui/or_fun_call.rs:411 :21
245
251
|
246
252
LL | let _ = opt_foo.unwrap_or(Foo { val: String::default() });
247
253
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| Foo { val: String::default() })`
248
254
249
255
error: function call inside of `map_or`
250
- --> tests/ui/or_fun_call.rs:424 :19
256
+ --> tests/ui/or_fun_call.rs:426 :19
251
257
|
252
258
LL | let _ = x.map_or(g(), |v| v);
253
259
| ^^^^^^^^^^^^^^^^^^ help: try: `map_or_else(|_| g(), |v| v)`
254
260
255
261
error: function call inside of `map_or`
256
- --> tests/ui/or_fun_call.rs:426 :19
262
+ --> tests/ui/or_fun_call.rs:428 :19
257
263
|
258
264
LL | let _ = x.map_or(g(), f);
259
265
| ^^^^^^^^^^^^^^ help: try: `map_or_else(|_| g(), f)`
260
266
267
+ error: function call inside of `map_or`
268
+ --> tests/ui/or_fun_call.rs:431:19
269
+ |
270
+ LL | let _ = x.map_or("asd".to_string().len() as i32, f);
271
+ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map_or_else(|_| "asd".to_string().len() as i32, f)`
272
+
261
273
error: function call inside of `get_or_insert`
262
- --> tests/ui/or_fun_call.rs:438 :15
274
+ --> tests/ui/or_fun_call.rs:442 :15
263
275
|
264
276
LL | let _ = x.get_or_insert(g());
265
277
| ^^^^^^^^^^^^^^^^^^ help: try: `get_or_insert_with(g)`
266
278
267
279
error: function call inside of `and`
268
- --> tests/ui/or_fun_call.rs:448 :15
280
+ --> tests/ui/or_fun_call.rs:452 :15
269
281
|
270
282
LL | let _ = x.and(g());
271
283
| ^^^^^^^^ help: try: `and_then(|_| g())`
272
284
273
285
error: function call inside of `and`
274
- --> tests/ui/or_fun_call.rs:458 :15
286
+ --> tests/ui/or_fun_call.rs:462 :15
275
287
|
276
288
LL | let _ = x.and(g());
277
289
| ^^^^^^^^ help: try: `and_then(|_| g())`
278
290
279
- error: aborting due to 43 previous errors
291
+ error: aborting due to 45 previous errors
280
292
0 commit comments