@@ -142,74 +142,98 @@ error: function call inside of `unwrap_or`
142142LL | None.unwrap_or( unsafe { ptr_to_ref(s) } );
143143 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| unsafe { ptr_to_ref(s) })`
144144
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+
145169error: function call inside of `map_or`
146- --> tests/ui/or_fun_call.rs:276 :25
170+ --> tests/ui/or_fun_call.rs:280 :25
147171 |
148172LL | let _ = Some(4).map_or(g(), |v| v);
149173 | ^^^^^^^^^^^^^^^^^^ help: try: `map_or_else(g, |v| v)`
150174
151175error: function call inside of `map_or`
152- --> tests/ui/or_fun_call.rs:278 :25
176+ --> tests/ui/or_fun_call.rs:282 :25
153177 |
154178LL | let _ = Some(4).map_or(g(), f);
155179 | ^^^^^^^^^^^^^^ help: try: `map_or_else(g, f)`
156180
157181error: 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
159183 |
160184LL | with_new.unwrap_or_else(Vec::new);
161185 | ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
162186
163187error: 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
165189 |
166190LL | with_default_trait.unwrap_or_else(Default::default);
167191 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
168192
169193error: 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
171195 |
172196LL | with_default_type.unwrap_or_else(u64::default);
173197 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
174198
175199error: 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
177201 |
178202LL | real_default.unwrap_or_else(<FakeDefault as Default>::default);
179203 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
180204
181205error: 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
183207 |
184208LL | map.entry(42).or_insert_with(String::new);
185209 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
186210
187211error: 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
189213 |
190214LL | btree.entry(42).or_insert_with(String::new);
191215 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
192216
193217error: 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
195219 |
196220LL | let _ = stringy.unwrap_or_else(String::new);
197221 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
198222
199223error: function call inside of `unwrap_or`
200- --> tests/ui/or_fun_call.rs:376 :17
224+ --> tests/ui/or_fun_call.rs:380 :17
201225 |
202226LL | let _ = opt.unwrap_or({ f() }); // suggest `.unwrap_or_else(f)`
203227 | ^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(f)`
204228
205229error: function call inside of `unwrap_or`
206- --> tests/ui/or_fun_call.rs:381 :17
230+ --> tests/ui/or_fun_call.rs:385 :17
207231 |
208232LL | let _ = opt.unwrap_or(f() + 1); // suggest `.unwrap_or_else(|| f() + 1)`
209233 | ^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| f() + 1)`
210234
211235error: function call inside of `unwrap_or`
212- --> tests/ui/or_fun_call.rs:386 :17
236+ --> tests/ui/or_fun_call.rs:390 :17
213237 |
214238LL | let _ = opt.unwrap_or({
215239 | _________________^
@@ -229,22 +253,22 @@ LL ~ });
229253 |
230254
231255error: function call inside of `map_or`
232- --> tests/ui/or_fun_call.rs:392 :17
256+ --> tests/ui/or_fun_call.rs:396 :17
233257 |
234258LL | let _ = opt.map_or(f() + 1, |v| v); // suggest `.map_or_else(|| f() + 1, |v| v)`
235259 | ^^^^^^^^^^^^^^^^^^^^^^ help: try: `map_or_else(|| f() + 1, |v| v)`
236260
237261error: 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
239263 |
240264LL | let _ = opt.unwrap_or({ i32::default() });
241265 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
242266
243267error: function call inside of `unwrap_or`
244- --> tests/ui/or_fun_call.rs:404 :21
268+ --> tests/ui/or_fun_call.rs:408 :21
245269 |
246270LL | let _ = opt_foo.unwrap_or(Foo { val: String::default() });
247271 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| Foo { val: String::default() })`
248272
249- error: aborting due to 38 previous errors
273+ error: aborting due to 42 previous errors
250274
0 commit comments