@@ -154,62 +154,68 @@ error: function call inside of `map_or`
154154LL | let _ = Some(4).map_or(g(), f);
155155 | ^^^^^^^^^^^^^^ help: try: `map_or_else(g, f)`
156156
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+
157163error: 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
159165 |
160166LL | with_new.unwrap_or_else(Vec::new);
161167 | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
162168
163169error: 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
165171 |
166172LL | with_default_trait.unwrap_or_else(Default::default);
167173 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
168174
169175error: 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
171177 |
172178LL | with_default_type.unwrap_or_else(u64::default);
173179 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
174180
175181error: 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
177183 |
178184LL | real_default.unwrap_or_else(<FakeDefault as Default>::default);
179185 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
180186
181187error: 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
183189 |
184190LL | map.entry(42).or_insert_with(String::new);
185191 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
186192
187193error: 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
189195 |
190196LL | btree.entry(42).or_insert_with(String::new);
191197 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
192198
193199error: 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
195201 |
196202LL | let _ = stringy.unwrap_or_else(String::new);
197203 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
198204
199205error: function call inside of `unwrap_or`
200- --> tests/ui/or_fun_call.rs:381 :17
206+ --> tests/ui/or_fun_call.rs:383 :17
201207 |
202208LL | let _ = opt.unwrap_or({ f() }); // suggest `.unwrap_or_else(f)`
203209 | ^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(f)`
204210
205211error: function call inside of `unwrap_or`
206- --> tests/ui/or_fun_call.rs:386 :17
212+ --> tests/ui/or_fun_call.rs:388 :17
207213 |
208214LL | let _ = opt.unwrap_or(f() + 1); // suggest `.unwrap_or_else(|| f() + 1)`
209215 | ^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| f() + 1)`
210216
211217error: function call inside of `unwrap_or`
212- --> tests/ui/or_fun_call.rs:391 :17
218+ --> tests/ui/or_fun_call.rs:393 :17
213219 |
214220LL | let _ = opt.unwrap_or({
215221 | _________________^
@@ -229,52 +235,58 @@ LL ~ });
229235 |
230236
231237error: function call inside of `map_or`
232- --> tests/ui/or_fun_call.rs:397 :17
238+ --> tests/ui/or_fun_call.rs:399 :17
233239 |
234240LL | let _ = opt.map_or(f() + 1, |v| v); // suggest `.map_or_else(|| f() + 1, |v| v)`
235241 | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `map_or_else(|| f() + 1, |v| v)`
236242
237243error: 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
239245 |
240246LL | let _ = opt.unwrap_or({ i32::default() });
241247 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
242248
243249error: function call inside of `unwrap_or`
244- --> tests/ui/or_fun_call.rs:409 :21
250+ --> tests/ui/or_fun_call.rs:411 :21
245251 |
246252LL | let _ = opt_foo.unwrap_or(Foo { val: String::default() });
247253 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| Foo { val: String::default() })`
248254
249255error: function call inside of `map_or`
250- --> tests/ui/or_fun_call.rs:424 :19
256+ --> tests/ui/or_fun_call.rs:426 :19
251257 |
252258LL | let _ = x.map_or(g(), |v| v);
253259 | ^^^^^^^^^^^^^^^^^^ help: try: `map_or_else(|_| g(), |v| v)`
254260
255261error: function call inside of `map_or`
256- --> tests/ui/or_fun_call.rs:426 :19
262+ --> tests/ui/or_fun_call.rs:428 :19
257263 |
258264LL | let _ = x.map_or(g(), f);
259265 | ^^^^^^^^^^^^^^ help: try: `map_or_else(|_| g(), f)`
260266
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+
261273error: 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
263275 |
264276LL | let _ = x.get_or_insert(g());
265277 | ^^^^^^^^^^^^^^^^^^ help: try: `get_or_insert_with(g)`
266278
267279error: function call inside of `and`
268- --> tests/ui/or_fun_call.rs:448 :15
280+ --> tests/ui/or_fun_call.rs:452 :15
269281 |
270282LL | let _ = x.and(g());
271283 | ^^^^^^^^ help: try: `and_then(|_| g())`
272284
273285error: function call inside of `and`
274- --> tests/ui/or_fun_call.rs:458 :15
286+ --> tests/ui/or_fun_call.rs:462 :15
275287 |
276288LL | let _ = x.and(g());
277289 | ^^^^^^^^ help: try: `and_then(|_| g())`
278290
279- error: aborting due to 43 previous errors
291+ error: aborting due to 45 previous errors
280292
0 commit comments