@@ -4,6 +4,7 @@ use rustc_span::{symbol::Ident, Span, Symbol};
4
4
5
5
#[ derive( Diagnostic , Clone , Copy ) ]
6
6
#[ diag( ast_lowering_generic_type_with_parentheses, code = "E0214" ) ]
7
+ #[ must_use]
7
8
pub struct GenericTypeWithParentheses {
8
9
#[ primary_span]
9
10
#[ label]
@@ -24,6 +25,7 @@ pub struct UseAngleBrackets {
24
25
#[ derive( Diagnostic ) ]
25
26
#[ diag( ast_lowering_invalid_abi, code = "E0703" ) ]
26
27
#[ note]
28
+ #[ must_use]
27
29
pub struct InvalidAbi {
28
30
#[ primary_span]
29
31
#[ label]
@@ -65,6 +67,7 @@ pub struct InvalidAbiSuggestion {
65
67
66
68
#[ derive( Diagnostic , Clone , Copy ) ]
67
69
#[ diag( ast_lowering_assoc_ty_parentheses) ]
70
+ #[ must_use]
68
71
pub struct AssocTyParentheses {
69
72
#[ primary_span]
70
73
pub span : Span ,
@@ -90,6 +93,7 @@ pub enum AssocTyParenthesesSub {
90
93
91
94
#[ derive( Diagnostic ) ]
92
95
#[ diag( ast_lowering_misplaced_impl_trait, code = "E0562" ) ]
96
+ #[ must_use]
93
97
pub struct MisplacedImplTrait < ' a > {
94
98
#[ primary_span]
95
99
pub span : Span ,
@@ -98,6 +102,7 @@ pub struct MisplacedImplTrait<'a> {
98
102
99
103
#[ derive( Diagnostic ) ]
100
104
#[ diag( ast_lowering_misplaced_assoc_ty_binding) ]
105
+ #[ must_use]
101
106
pub struct MisplacedAssocTyBinding < ' a > {
102
107
#[ primary_span]
103
108
pub span : Span ,
@@ -106,6 +111,7 @@ pub struct MisplacedAssocTyBinding<'a> {
106
111
107
112
#[ derive( Diagnostic , Clone , Copy ) ]
108
113
#[ diag( ast_lowering_underscore_expr_lhs_assign) ]
114
+ #[ must_use]
109
115
pub struct UnderscoreExprLhsAssign {
110
116
#[ primary_span]
111
117
#[ label]
@@ -114,6 +120,7 @@ pub struct UnderscoreExprLhsAssign {
114
120
115
121
#[ derive( Diagnostic , Clone , Copy ) ]
116
122
#[ diag( ast_lowering_base_expression_double_dot) ]
123
+ #[ must_use]
117
124
pub struct BaseExpressionDoubleDot {
118
125
#[ primary_span]
119
126
#[ label]
@@ -122,6 +129,7 @@ pub struct BaseExpressionDoubleDot {
122
129
123
130
#[ derive( Diagnostic , Clone , Copy ) ]
124
131
#[ diag( ast_lowering_await_only_in_async_fn_and_blocks, code = "E0728" ) ]
132
+ #[ must_use]
125
133
pub struct AwaitOnlyInAsyncFnAndBlocks {
126
134
#[ primary_span]
127
135
#[ label]
@@ -132,13 +140,15 @@ pub struct AwaitOnlyInAsyncFnAndBlocks {
132
140
133
141
#[ derive( Diagnostic , Clone , Copy ) ]
134
142
#[ diag( ast_lowering_coroutine_too_many_parameters, code = "E0628" ) ]
143
+ #[ must_use]
135
144
pub struct CoroutineTooManyParameters {
136
145
#[ primary_span]
137
146
pub fn_decl_span : Span ,
138
147
}
139
148
140
149
#[ derive( Diagnostic , Clone , Copy ) ]
141
150
#[ diag( ast_lowering_closure_cannot_be_static, code = "E0697" ) ]
151
+ #[ must_use]
142
152
pub struct ClosureCannotBeStatic {
143
153
#[ primary_span]
144
154
pub fn_decl_span : Span ,
@@ -147,13 +157,15 @@ pub struct ClosureCannotBeStatic {
147
157
#[ derive( Diagnostic , Clone , Copy ) ]
148
158
#[ help]
149
159
#[ diag( ast_lowering_async_non_move_closure_not_supported, code = "E0708" ) ]
160
+ #[ must_use]
150
161
pub struct AsyncNonMoveClosureNotSupported {
151
162
#[ primary_span]
152
163
pub fn_decl_span : Span ,
153
164
}
154
165
155
166
#[ derive( Diagnostic , Clone , Copy ) ]
156
167
#[ diag( ast_lowering_functional_record_update_destructuring_assignment) ]
168
+ #[ must_use]
157
169
pub struct FunctionalRecordUpdateDestructuringAssignment {
158
170
#[ primary_span]
159
171
#[ suggestion( code = "" , applicability = "machine-applicable" ) ]
@@ -162,27 +174,31 @@ pub struct FunctionalRecordUpdateDestructuringAssignment {
162
174
163
175
#[ derive( Diagnostic , Clone , Copy ) ]
164
176
#[ diag( ast_lowering_async_coroutines_not_supported, code = "E0727" ) ]
177
+ #[ must_use]
165
178
pub struct AsyncCoroutinesNotSupported {
166
179
#[ primary_span]
167
180
pub span : Span ,
168
181
}
169
182
170
183
#[ derive( Diagnostic , Clone , Copy ) ]
171
184
#[ diag( ast_lowering_inline_asm_unsupported_target, code = "E0472" ) ]
185
+ #[ must_use]
172
186
pub struct InlineAsmUnsupportedTarget {
173
187
#[ primary_span]
174
188
pub span : Span ,
175
189
}
176
190
177
191
#[ derive( Diagnostic , Clone , Copy ) ]
178
192
#[ diag( ast_lowering_att_syntax_only_x86) ]
193
+ #[ must_use]
179
194
pub struct AttSyntaxOnlyX86 {
180
195
#[ primary_span]
181
196
pub span : Span ,
182
197
}
183
198
184
199
#[ derive( Diagnostic , Clone , Copy ) ]
185
200
#[ diag( ast_lowering_abi_specified_multiple_times) ]
201
+ #[ must_use]
186
202
pub struct AbiSpecifiedMultipleTimes {
187
203
#[ primary_span]
188
204
pub abi_span : Span ,
@@ -195,6 +211,7 @@ pub struct AbiSpecifiedMultipleTimes {
195
211
196
212
#[ derive( Diagnostic , Clone , Copy ) ]
197
213
#[ diag( ast_lowering_clobber_abi_not_supported) ]
214
+ #[ must_use]
198
215
pub struct ClobberAbiNotSupported {
199
216
#[ primary_span]
200
217
pub abi_span : Span ,
@@ -203,6 +220,7 @@ pub struct ClobberAbiNotSupported {
203
220
#[ derive( Diagnostic ) ]
204
221
#[ note]
205
222
#[ diag( ast_lowering_invalid_abi_clobber_abi) ]
223
+ #[ must_use]
206
224
pub struct InvalidAbiClobberAbi {
207
225
#[ primary_span]
208
226
pub abi_span : Span ,
@@ -211,6 +229,7 @@ pub struct InvalidAbiClobberAbi {
211
229
212
230
#[ derive( Diagnostic , Clone , Copy ) ]
213
231
#[ diag( ast_lowering_invalid_register) ]
232
+ #[ must_use]
214
233
pub struct InvalidRegister < ' a > {
215
234
#[ primary_span]
216
235
pub op_span : Span ,
@@ -220,6 +239,7 @@ pub struct InvalidRegister<'a> {
220
239
221
240
#[ derive( Diagnostic , Clone , Copy ) ]
222
241
#[ diag( ast_lowering_invalid_register_class) ]
242
+ #[ must_use]
223
243
pub struct InvalidRegisterClass < ' a > {
224
244
#[ primary_span]
225
245
pub op_span : Span ,
@@ -229,6 +249,7 @@ pub struct InvalidRegisterClass<'a> {
229
249
230
250
#[ derive( Diagnostic ) ]
231
251
#[ diag( ast_lowering_invalid_asm_template_modifier_reg_class) ]
252
+ #[ must_use]
232
253
pub struct InvalidAsmTemplateModifierRegClass {
233
254
#[ primary_span]
234
255
#[ label( ast_lowering_template_modifier) ]
@@ -249,6 +270,7 @@ pub enum InvalidAsmTemplateModifierRegClassSub {
249
270
250
271
#[ derive( Diagnostic , Clone , Copy ) ]
251
272
#[ diag( ast_lowering_invalid_asm_template_modifier_const) ]
273
+ #[ must_use]
252
274
pub struct InvalidAsmTemplateModifierConst {
253
275
#[ primary_span]
254
276
#[ label( ast_lowering_template_modifier) ]
@@ -259,6 +281,7 @@ pub struct InvalidAsmTemplateModifierConst {
259
281
260
282
#[ derive( Diagnostic , Clone , Copy ) ]
261
283
#[ diag( ast_lowering_invalid_asm_template_modifier_sym) ]
284
+ #[ must_use]
262
285
pub struct InvalidAsmTemplateModifierSym {
263
286
#[ primary_span]
264
287
#[ label( ast_lowering_template_modifier) ]
@@ -269,6 +292,7 @@ pub struct InvalidAsmTemplateModifierSym {
269
292
270
293
#[ derive( Diagnostic , Clone , Copy ) ]
271
294
#[ diag( ast_lowering_register_class_only_clobber) ]
295
+ #[ must_use]
272
296
pub struct RegisterClassOnlyClobber {
273
297
#[ primary_span]
274
298
pub op_span : Span ,
@@ -277,6 +301,7 @@ pub struct RegisterClassOnlyClobber {
277
301
278
302
#[ derive( Diagnostic , Clone , Copy ) ]
279
303
#[ diag( ast_lowering_register_conflict) ]
304
+ #[ must_use]
280
305
pub struct RegisterConflict < ' a > {
281
306
#[ primary_span]
282
307
#[ label( ast_lowering_register1) ]
@@ -292,6 +317,7 @@ pub struct RegisterConflict<'a> {
292
317
#[ derive( Diagnostic , Clone , Copy ) ]
293
318
#[ help]
294
319
#[ diag( ast_lowering_sub_tuple_binding) ]
320
+ #[ must_use]
295
321
pub struct SubTupleBinding < ' a > {
296
322
#[ primary_span]
297
323
#[ label]
@@ -309,6 +335,7 @@ pub struct SubTupleBinding<'a> {
309
335
310
336
#[ derive( Diagnostic , Clone , Copy ) ]
311
337
#[ diag( ast_lowering_extra_double_dot) ]
338
+ #[ must_use]
312
339
pub struct ExtraDoubleDot < ' a > {
313
340
#[ primary_span]
314
341
#[ label]
@@ -321,27 +348,31 @@ pub struct ExtraDoubleDot<'a> {
321
348
#[ derive( Diagnostic , Clone , Copy ) ]
322
349
#[ note]
323
350
#[ diag( ast_lowering_misplaced_double_dot) ]
351
+ #[ must_use]
324
352
pub struct MisplacedDoubleDot {
325
353
#[ primary_span]
326
354
pub span : Span ,
327
355
}
328
356
329
357
#[ derive( Diagnostic , Clone , Copy ) ]
330
358
#[ diag( ast_lowering_misplaced_relax_trait_bound) ]
359
+ #[ must_use]
331
360
pub struct MisplacedRelaxTraitBound {
332
361
#[ primary_span]
333
362
pub span : Span ,
334
363
}
335
364
336
365
#[ derive( Diagnostic , Clone , Copy ) ]
337
366
#[ diag( ast_lowering_not_supported_for_lifetime_binder_async_closure) ]
367
+ #[ must_use]
338
368
pub struct NotSupportedForLifetimeBinderAsyncClosure {
339
369
#[ primary_span]
340
370
pub span : Span ,
341
371
}
342
372
343
373
#[ derive( Diagnostic ) ]
344
374
#[ diag( ast_lowering_match_arm_with_no_body) ]
375
+ #[ must_use]
345
376
pub struct MatchArmWithNoBody {
346
377
#[ primary_span]
347
378
pub span : Span ,
@@ -351,6 +382,7 @@ pub struct MatchArmWithNoBody {
351
382
352
383
#[ derive( Diagnostic ) ]
353
384
#[ diag( ast_lowering_never_pattern_with_body) ]
385
+ #[ must_use]
354
386
pub struct NeverPatternWithBody {
355
387
#[ primary_span]
356
388
#[ label]
@@ -360,6 +392,7 @@ pub struct NeverPatternWithBody {
360
392
361
393
#[ derive( Diagnostic ) ]
362
394
#[ diag( ast_lowering_never_pattern_with_guard) ]
395
+ #[ must_use]
363
396
pub struct NeverPatternWithGuard {
364
397
#[ primary_span]
365
398
#[ suggestion( code = "" , applicability = "maybe-incorrect" ) ]
@@ -368,13 +401,15 @@ pub struct NeverPatternWithGuard {
368
401
369
402
#[ derive( Diagnostic , Clone , Copy ) ]
370
403
#[ diag( ast_lowering_arbitrary_expression_in_pattern) ]
404
+ #[ must_use]
371
405
pub struct ArbitraryExpressionInPattern {
372
406
#[ primary_span]
373
407
pub span : Span ,
374
408
}
375
409
376
410
#[ derive( Diagnostic , Clone , Copy ) ]
377
411
#[ diag( ast_lowering_inclusive_range_with_no_end) ]
412
+ #[ must_use]
378
413
pub struct InclusiveRangeWithNoEnd {
379
414
#[ primary_span]
380
415
pub span : Span ,
0 commit comments