@@ -47,175 +47,175 @@ LL | with_default_type.unwrap_or(u64::default());
47
47
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
48
48
49
49
error: function call inside of `unwrap_or`
50
- --> tests/ui/or_fun_call.rs:93 :18
50
+ --> tests/ui/or_fun_call.rs:97 :18
51
51
|
52
52
LL | self_default.unwrap_or(<FakeDefault>::default());
53
53
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(<FakeDefault>::default)`
54
54
55
55
error: use of `unwrap_or` to construct default value
56
- --> tests/ui/or_fun_call.rs:97 :18
56
+ --> tests/ui/or_fun_call.rs:101 :18
57
57
|
58
58
LL | real_default.unwrap_or(<FakeDefault as Default>::default());
59
59
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
60
60
61
61
error: use of `unwrap_or` to construct default value
62
- --> tests/ui/or_fun_call.rs:101 :14
62
+ --> tests/ui/or_fun_call.rs:105 :14
63
63
|
64
- LL | with_vec.unwrap_or(vec![] );
65
- | ^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
64
+ LL | with_vec.unwrap_or(Vec::new() );
65
+ | ^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
66
66
67
67
error: function call inside of `unwrap_or`
68
- --> tests/ui/or_fun_call.rs:105 :21
68
+ --> tests/ui/or_fun_call.rs:109 :21
69
69
|
70
70
LL | without_default.unwrap_or(Foo::new());
71
71
| ^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(Foo::new)`
72
72
73
73
error: use of `or_insert` to construct default value
74
- --> tests/ui/or_fun_call.rs:109 :19
74
+ --> tests/ui/or_fun_call.rs:113 :19
75
75
|
76
76
LL | map.entry(42).or_insert(String::new());
77
77
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
78
78
79
79
error: use of `or_insert` to construct default value
80
- --> tests/ui/or_fun_call.rs:113 :23
80
+ --> tests/ui/or_fun_call.rs:117 :23
81
81
|
82
- LL | map_vec.entry(42).or_insert(vec![] );
83
- | ^^^^^^^^^^^^^^^^^ help: try: `or_default()`
82
+ LL | map_vec.entry(42).or_insert(Vec::new() );
83
+ | ^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
84
84
85
85
error: use of `or_insert` to construct default value
86
- --> tests/ui/or_fun_call.rs:117 :21
86
+ --> tests/ui/or_fun_call.rs:121 :21
87
87
|
88
88
LL | btree.entry(42).or_insert(String::new());
89
89
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
90
90
91
91
error: use of `or_insert` to construct default value
92
- --> tests/ui/or_fun_call.rs:121 :25
92
+ --> tests/ui/or_fun_call.rs:125 :25
93
93
|
94
- LL | btree_vec.entry(42).or_insert(vec![] );
95
- | ^^^^^^^^^^^^^^^^^ help: try: `or_default()`
94
+ LL | btree_vec.entry(42).or_insert(Vec::new() );
95
+ | ^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
96
96
97
97
error: use of `unwrap_or` to construct default value
98
- --> tests/ui/or_fun_call.rs:125 :21
98
+ --> tests/ui/or_fun_call.rs:129 :21
99
99
|
100
100
LL | let _ = stringy.unwrap_or(String::new());
101
101
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
102
102
103
103
error: function call inside of `ok_or`
104
- --> tests/ui/or_fun_call.rs:130 :17
104
+ --> tests/ui/or_fun_call.rs:134 :17
105
105
|
106
106
LL | let _ = opt.ok_or(format!("{} world.", hello));
107
107
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `ok_or_else(|| format!("{} world.", hello))`
108
108
109
109
error: function call inside of `unwrap_or`
110
- --> tests/ui/or_fun_call.rs:135 :21
110
+ --> tests/ui/or_fun_call.rs:139 :21
111
111
|
112
112
LL | let _ = Some(1).unwrap_or(map[&1]);
113
113
| ^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| map[&1])`
114
114
115
115
error: function call inside of `unwrap_or`
116
- --> tests/ui/or_fun_call.rs:138 :21
116
+ --> tests/ui/or_fun_call.rs:142 :21
117
117
|
118
118
LL | let _ = Some(1).unwrap_or(map[&1]);
119
119
| ^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| map[&1])`
120
120
121
121
error: function call inside of `or`
122
- --> tests/ui/or_fun_call.rs:163 :35
122
+ --> tests/ui/or_fun_call.rs:167 :35
123
123
|
124
124
LL | let _ = Some("a".to_string()).or(Some("b".to_string()));
125
125
| ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_else(|| Some("b".to_string()))`
126
126
127
127
error: function call inside of `unwrap_or`
128
- --> tests/ui/or_fun_call.rs:206 :18
128
+ --> tests/ui/or_fun_call.rs:210 :18
129
129
|
130
130
LL | None.unwrap_or(ptr_to_ref(s));
131
131
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| ptr_to_ref(s))`
132
132
133
133
error: function call inside of `unwrap_or`
134
- --> tests/ui/or_fun_call.rs:214 :14
134
+ --> tests/ui/or_fun_call.rs:218 :14
135
135
|
136
136
LL | None.unwrap_or(unsafe { ptr_to_ref(s) });
137
137
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| unsafe { ptr_to_ref(s) })`
138
138
139
139
error: function call inside of `unwrap_or`
140
- --> tests/ui/or_fun_call.rs:217 :14
140
+ --> tests/ui/or_fun_call.rs:221 :14
141
141
|
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
145
error: function call inside of `map_or`
146
- --> tests/ui/or_fun_call.rs:293 :25
146
+ --> tests/ui/or_fun_call.rs:297 :25
147
147
|
148
148
LL | let _ = Some(4).map_or(g(), |v| v);
149
149
| ^^^^^^^^^^^^^^^^^^ help: try: `map_or_else(g, |v| v)`
150
150
151
151
error: function call inside of `map_or`
152
- --> tests/ui/or_fun_call.rs:295 :25
152
+ --> tests/ui/or_fun_call.rs:299 :25
153
153
|
154
154
LL | let _ = Some(4).map_or(g(), f);
155
155
| ^^^^^^^^^^^^^^ help: try: `map_or_else(g, f)`
156
156
157
157
error: function call inside of `map_or`
158
- --> tests/ui/or_fun_call.rs:298 :25
158
+ --> tests/ui/or_fun_call.rs:302 :25
159
159
|
160
160
LL | let _ = Some(4).map_or("asd".to_string().len() as i32, f);
161
161
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map_or_else(|| "asd".to_string().len() as i32, f)`
162
162
163
163
error: use of `unwrap_or_else` to construct default value
164
- --> tests/ui/or_fun_call.rs:329 :18
164
+ --> tests/ui/or_fun_call.rs:333 :18
165
165
|
166
166
LL | with_new.unwrap_or_else(Vec::new);
167
167
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
168
168
169
169
error: use of `unwrap_or_else` to construct default value
170
- --> tests/ui/or_fun_call.rs:333 :28
170
+ --> tests/ui/or_fun_call.rs:337 :28
171
171
|
172
172
LL | with_default_trait.unwrap_or_else(Default::default);
173
173
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
174
174
175
175
error: use of `unwrap_or_else` to construct default value
176
- --> tests/ui/or_fun_call.rs:337 :27
176
+ --> tests/ui/or_fun_call.rs:341 :27
177
177
|
178
178
LL | with_default_type.unwrap_or_else(u64::default);
179
179
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
180
180
181
181
error: use of `unwrap_or_else` to construct default value
182
- --> tests/ui/or_fun_call.rs:341 :22
182
+ --> tests/ui/or_fun_call.rs:345 :22
183
183
|
184
184
LL | real_default.unwrap_or_else(<FakeDefault as Default>::default);
185
185
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
186
186
187
187
error: use of `or_insert_with` to construct default value
188
- --> tests/ui/or_fun_call.rs:345 :23
188
+ --> tests/ui/or_fun_call.rs:349 :23
189
189
|
190
190
LL | map.entry(42).or_insert_with(String::new);
191
191
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
192
192
193
193
error: use of `or_insert_with` to construct default value
194
- --> tests/ui/or_fun_call.rs:349 :25
194
+ --> tests/ui/or_fun_call.rs:353 :25
195
195
|
196
196
LL | btree.entry(42).or_insert_with(String::new);
197
197
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `or_default()`
198
198
199
199
error: use of `unwrap_or_else` to construct default value
200
- --> tests/ui/or_fun_call.rs:353 :25
200
+ --> tests/ui/or_fun_call.rs:357 :25
201
201
|
202
202
LL | let _ = stringy.unwrap_or_else(String::new);
203
203
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
204
204
205
205
error: function call inside of `unwrap_or`
206
- --> tests/ui/or_fun_call.rs:395 :17
206
+ --> tests/ui/or_fun_call.rs:399 :17
207
207
|
208
208
LL | let _ = opt.unwrap_or({ f() }); // suggest `.unwrap_or_else(f)`
209
209
| ^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(f)`
210
210
211
211
error: function call inside of `unwrap_or`
212
- --> tests/ui/or_fun_call.rs:400 :17
212
+ --> tests/ui/or_fun_call.rs:404 :17
213
213
|
214
214
LL | let _ = opt.unwrap_or(f() + 1); // suggest `.unwrap_or_else(|| f() + 1)`
215
215
| ^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| f() + 1)`
216
216
217
217
error: function call inside of `unwrap_or`
218
- --> tests/ui/or_fun_call.rs:405 :17
218
+ --> tests/ui/or_fun_call.rs:409 :17
219
219
|
220
220
LL | let _ = opt.unwrap_or({
221
221
| _________________^
@@ -235,55 +235,55 @@ LL ~ });
235
235
|
236
236
237
237
error: function call inside of `map_or`
238
- --> tests/ui/or_fun_call.rs:411 :17
238
+ --> tests/ui/or_fun_call.rs:415 :17
239
239
|
240
240
LL | let _ = opt.map_or(f() + 1, |v| v); // suggest `.map_or_else(|| f() + 1, |v| v)`
241
241
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `map_or_else(|| f() + 1, |v| v)`
242
242
243
243
error: use of `unwrap_or` to construct default value
244
- --> tests/ui/or_fun_call.rs:416 :17
244
+ --> tests/ui/or_fun_call.rs:420 :17
245
245
|
246
246
LL | let _ = opt.unwrap_or({ i32::default() });
247
247
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_default()`
248
248
249
249
error: function call inside of `unwrap_or`
250
- --> tests/ui/or_fun_call.rs:423 :21
250
+ --> tests/ui/or_fun_call.rs:427 :21
251
251
|
252
252
LL | let _ = opt_foo.unwrap_or(Foo { val: String::default() });
253
253
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `unwrap_or_else(|| Foo { val: String::default() })`
254
254
255
255
error: function call inside of `map_or`
256
- --> tests/ui/or_fun_call.rs:438 :19
256
+ --> tests/ui/or_fun_call.rs:442 :19
257
257
|
258
258
LL | let _ = x.map_or(g(), |v| v);
259
259
| ^^^^^^^^^^^^^^^^^^ help: try: `map_or_else(|_| g(), |v| v)`
260
260
261
261
error: function call inside of `map_or`
262
- --> tests/ui/or_fun_call.rs:440 :19
262
+ --> tests/ui/or_fun_call.rs:444 :19
263
263
|
264
264
LL | let _ = x.map_or(g(), f);
265
265
| ^^^^^^^^^^^^^^ help: try: `map_or_else(|_| g(), f)`
266
266
267
267
error: function call inside of `map_or`
268
- --> tests/ui/or_fun_call.rs:443 :19
268
+ --> tests/ui/or_fun_call.rs:447 :19
269
269
|
270
270
LL | let _ = x.map_or("asd".to_string().len() as i32, f);
271
271
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `map_or_else(|_| "asd".to_string().len() as i32, f)`
272
272
273
273
error: function call inside of `get_or_insert`
274
- --> tests/ui/or_fun_call.rs:454 :15
274
+ --> tests/ui/or_fun_call.rs:458 :15
275
275
|
276
276
LL | let _ = x.get_or_insert(g());
277
277
| ^^^^^^^^^^^^^^^^^^ help: try: `get_or_insert_with(g)`
278
278
279
279
error: function call inside of `and`
280
- --> tests/ui/or_fun_call.rs:464 :15
280
+ --> tests/ui/or_fun_call.rs:468 :15
281
281
|
282
282
LL | let _ = x.and(g());
283
283
| ^^^^^^^^ help: try: `and_then(|_| g())`
284
284
285
285
error: function call inside of `and`
286
- --> tests/ui/or_fun_call.rs:474 :15
286
+ --> tests/ui/or_fun_call.rs:478 :15
287
287
|
288
288
LL | let _ = x.and(g());
289
289
| ^^^^^^^^ help: try: `and_then(|_| g())`
0 commit comments