1
1
use rustc_errors:: {
2
- codes:: * , AddToDiagnostic , Diag , DiagArgFromDisplay , EmissionGuarantee , SubdiagMessageOp ,
2
+ codes:: * , Diag , DiagArgFromDisplay , EmissionGuarantee , SubdiagMessageOp , Subdiagnostic ,
3
3
} ;
4
4
use rustc_macros:: { Diagnostic , Subdiagnostic } ;
5
5
use rustc_span:: { symbol:: Ident , Span , Symbol } ;
6
6
7
- #[ derive( Diagnostic , Clone , Copy ) ]
7
+ #[ derive( Diagnostic ) ]
8
8
#[ diag( ast_lowering_generic_type_with_parentheses, code = E0214 ) ]
9
9
pub struct GenericTypeWithParentheses {
10
10
#[ primary_span]
@@ -14,7 +14,7 @@ pub struct GenericTypeWithParentheses {
14
14
pub sub : Option < UseAngleBrackets > ,
15
15
}
16
16
17
- #[ derive( Clone , Copy , Subdiagnostic ) ]
17
+ #[ derive( Subdiagnostic ) ]
18
18
#[ multipart_suggestion( ast_lowering_use_angle_brackets, applicability = "maybe-incorrect" ) ]
19
19
pub struct UseAngleBrackets {
20
20
#[ suggestion_part( code = "<" ) ]
@@ -40,8 +40,8 @@ pub struct InvalidAbi {
40
40
41
41
pub struct InvalidAbiReason ( pub & ' static str ) ;
42
42
43
- impl AddToDiagnostic for InvalidAbiReason {
44
- fn add_to_diagnostic_with < G : EmissionGuarantee , F : SubdiagMessageOp < G > > (
43
+ impl Subdiagnostic for InvalidAbiReason {
44
+ fn add_to_diag_with < G : EmissionGuarantee , F : SubdiagMessageOp < G > > (
45
45
self ,
46
46
diag : & mut Diag < ' _ , G > ,
47
47
_: F ,
@@ -63,7 +63,7 @@ pub struct InvalidAbiSuggestion {
63
63
pub suggestion : String ,
64
64
}
65
65
66
- #[ derive( Diagnostic , Clone , Copy ) ]
66
+ #[ derive( Diagnostic ) ]
67
67
#[ diag( ast_lowering_assoc_ty_parentheses) ]
68
68
pub struct AssocTyParentheses {
69
69
#[ primary_span]
@@ -72,7 +72,7 @@ pub struct AssocTyParentheses {
72
72
pub sub : AssocTyParenthesesSub ,
73
73
}
74
74
75
- #[ derive( Clone , Copy , Subdiagnostic ) ]
75
+ #[ derive( Subdiagnostic ) ]
76
76
pub enum AssocTyParenthesesSub {
77
77
#[ multipart_suggestion( ast_lowering_remove_parentheses) ]
78
78
Empty {
@@ -106,23 +106,23 @@ pub struct MisplacedAssocTyBinding {
106
106
pub suggestion : Option < Span > ,
107
107
}
108
108
109
- #[ derive( Diagnostic , Clone , Copy ) ]
109
+ #[ derive( Diagnostic ) ]
110
110
#[ diag( ast_lowering_underscore_expr_lhs_assign) ]
111
111
pub struct UnderscoreExprLhsAssign {
112
112
#[ primary_span]
113
113
#[ label]
114
114
pub span : Span ,
115
115
}
116
116
117
- #[ derive( Diagnostic , Clone , Copy ) ]
117
+ #[ derive( Diagnostic ) ]
118
118
#[ diag( ast_lowering_base_expression_double_dot, code = E0797 ) ]
119
119
pub struct BaseExpressionDoubleDot {
120
120
#[ primary_span]
121
121
#[ suggestion( code = "/* expr */" , applicability = "has-placeholders" , style = "verbose" ) ]
122
122
pub span : Span ,
123
123
}
124
124
125
- #[ derive( Diagnostic , Clone , Copy ) ]
125
+ #[ derive( Diagnostic ) ]
126
126
#[ diag( ast_lowering_await_only_in_async_fn_and_blocks, code = E0728 ) ]
127
127
pub struct AwaitOnlyInAsyncFnAndBlocks {
128
128
#[ primary_span]
@@ -132,50 +132,50 @@ pub struct AwaitOnlyInAsyncFnAndBlocks {
132
132
pub item_span : Option < Span > ,
133
133
}
134
134
135
- #[ derive( Diagnostic , Clone , Copy ) ]
135
+ #[ derive( Diagnostic ) ]
136
136
#[ diag( ast_lowering_coroutine_too_many_parameters, code = E0628 ) ]
137
137
pub struct CoroutineTooManyParameters {
138
138
#[ primary_span]
139
139
pub fn_decl_span : Span ,
140
140
}
141
141
142
- #[ derive( Diagnostic , Clone , Copy ) ]
142
+ #[ derive( Diagnostic ) ]
143
143
#[ diag( ast_lowering_closure_cannot_be_static, code = E0697 ) ]
144
144
pub struct ClosureCannotBeStatic {
145
145
#[ primary_span]
146
146
pub fn_decl_span : Span ,
147
147
}
148
148
149
- #[ derive( Diagnostic , Clone , Copy ) ]
149
+ #[ derive( Diagnostic ) ]
150
150
#[ diag( ast_lowering_functional_record_update_destructuring_assignment) ]
151
151
pub struct FunctionalRecordUpdateDestructuringAssignment {
152
152
#[ primary_span]
153
153
#[ suggestion( code = "" , applicability = "machine-applicable" ) ]
154
154
pub span : Span ,
155
155
}
156
156
157
- #[ derive( Diagnostic , Clone , Copy ) ]
157
+ #[ derive( Diagnostic ) ]
158
158
#[ diag( ast_lowering_async_coroutines_not_supported, code = E0727 ) ]
159
159
pub struct AsyncCoroutinesNotSupported {
160
160
#[ primary_span]
161
161
pub span : Span ,
162
162
}
163
163
164
- #[ derive( Diagnostic , Clone , Copy ) ]
164
+ #[ derive( Diagnostic ) ]
165
165
#[ diag( ast_lowering_inline_asm_unsupported_target, code = E0472 ) ]
166
166
pub struct InlineAsmUnsupportedTarget {
167
167
#[ primary_span]
168
168
pub span : Span ,
169
169
}
170
170
171
- #[ derive( Diagnostic , Clone , Copy ) ]
171
+ #[ derive( Diagnostic ) ]
172
172
#[ diag( ast_lowering_att_syntax_only_x86) ]
173
173
pub struct AttSyntaxOnlyX86 {
174
174
#[ primary_span]
175
175
pub span : Span ,
176
176
}
177
177
178
- #[ derive( Diagnostic , Clone , Copy ) ]
178
+ #[ derive( Diagnostic ) ]
179
179
#[ diag( ast_lowering_abi_specified_multiple_times) ]
180
180
pub struct AbiSpecifiedMultipleTimes {
181
181
#[ primary_span]
@@ -187,7 +187,7 @@ pub struct AbiSpecifiedMultipleTimes {
187
187
pub equivalent : Option < ( ) > ,
188
188
}
189
189
190
- #[ derive( Diagnostic , Clone , Copy ) ]
190
+ #[ derive( Diagnostic ) ]
191
191
#[ diag( ast_lowering_clobber_abi_not_supported) ]
192
192
pub struct ClobberAbiNotSupported {
193
193
#[ primary_span]
@@ -203,7 +203,7 @@ pub struct InvalidAbiClobberAbi {
203
203
pub supported_abis : String ,
204
204
}
205
205
206
- #[ derive( Diagnostic , Clone , Copy ) ]
206
+ #[ derive( Diagnostic ) ]
207
207
#[ diag( ast_lowering_invalid_register) ]
208
208
pub struct InvalidRegister < ' a > {
209
209
#[ primary_span]
@@ -212,7 +212,7 @@ pub struct InvalidRegister<'a> {
212
212
pub error : & ' a str ,
213
213
}
214
214
215
- #[ derive( Diagnostic , Clone , Copy ) ]
215
+ #[ derive( Diagnostic ) ]
216
216
#[ diag( ast_lowering_invalid_register_class) ]
217
217
pub struct InvalidRegisterClass < ' a > {
218
218
#[ primary_span]
@@ -241,7 +241,7 @@ pub enum InvalidAsmTemplateModifierRegClassSub {
241
241
DoesNotSupportModifier { class_name : Symbol } ,
242
242
}
243
243
244
- #[ derive( Diagnostic , Clone , Copy ) ]
244
+ #[ derive( Diagnostic ) ]
245
245
#[ diag( ast_lowering_invalid_asm_template_modifier_const) ]
246
246
pub struct InvalidAsmTemplateModifierConst {
247
247
#[ primary_span]
@@ -251,7 +251,7 @@ pub struct InvalidAsmTemplateModifierConst {
251
251
pub op_span : Span ,
252
252
}
253
253
254
- #[ derive( Diagnostic , Clone , Copy ) ]
254
+ #[ derive( Diagnostic ) ]
255
255
#[ diag( ast_lowering_invalid_asm_template_modifier_sym) ]
256
256
pub struct InvalidAsmTemplateModifierSym {
257
257
#[ primary_span]
@@ -261,7 +261,7 @@ pub struct InvalidAsmTemplateModifierSym {
261
261
pub op_span : Span ,
262
262
}
263
263
264
- #[ derive( Diagnostic , Clone , Copy ) ]
264
+ #[ derive( Diagnostic ) ]
265
265
#[ diag( ast_lowering_invalid_asm_template_modifier_label) ]
266
266
pub struct InvalidAsmTemplateModifierLabel {
267
267
#[ primary_span]
@@ -271,15 +271,15 @@ pub struct InvalidAsmTemplateModifierLabel {
271
271
pub op_span : Span ,
272
272
}
273
273
274
- #[ derive( Diagnostic , Clone , Copy ) ]
274
+ #[ derive( Diagnostic ) ]
275
275
#[ diag( ast_lowering_register_class_only_clobber) ]
276
276
pub struct RegisterClassOnlyClobber {
277
277
#[ primary_span]
278
278
pub op_span : Span ,
279
279
pub reg_class_name : Symbol ,
280
280
}
281
281
282
- #[ derive( Diagnostic , Clone , Copy ) ]
282
+ #[ derive( Diagnostic ) ]
283
283
#[ diag( ast_lowering_register_conflict) ]
284
284
pub struct RegisterConflict < ' a > {
285
285
#[ primary_span]
@@ -293,7 +293,7 @@ pub struct RegisterConflict<'a> {
293
293
pub in_out : Option < Span > ,
294
294
}
295
295
296
- #[ derive( Diagnostic , Clone , Copy ) ]
296
+ #[ derive( Diagnostic ) ]
297
297
#[ help]
298
298
#[ diag( ast_lowering_sub_tuple_binding) ]
299
299
pub struct SubTupleBinding < ' a > {
@@ -311,7 +311,7 @@ pub struct SubTupleBinding<'a> {
311
311
pub ctx : & ' a str ,
312
312
}
313
313
314
- #[ derive( Diagnostic , Clone , Copy ) ]
314
+ #[ derive( Diagnostic ) ]
315
315
#[ diag( ast_lowering_extra_double_dot) ]
316
316
pub struct ExtraDoubleDot < ' a > {
317
317
#[ primary_span]
@@ -322,15 +322,15 @@ pub struct ExtraDoubleDot<'a> {
322
322
pub ctx : & ' a str ,
323
323
}
324
324
325
- #[ derive( Diagnostic , Clone , Copy ) ]
325
+ #[ derive( Diagnostic ) ]
326
326
#[ note]
327
327
#[ diag( ast_lowering_misplaced_double_dot) ]
328
328
pub struct MisplacedDoubleDot {
329
329
#[ primary_span]
330
330
pub span : Span ,
331
331
}
332
332
333
- #[ derive( Diagnostic , Clone , Copy ) ]
333
+ #[ derive( Diagnostic ) ]
334
334
#[ diag( ast_lowering_misplaced_relax_trait_bound) ]
335
335
pub struct MisplacedRelaxTraitBound {
336
336
#[ primary_span]
@@ -363,14 +363,14 @@ pub struct NeverPatternWithGuard {
363
363
pub span : Span ,
364
364
}
365
365
366
- #[ derive( Diagnostic , Clone , Copy ) ]
366
+ #[ derive( Diagnostic ) ]
367
367
#[ diag( ast_lowering_arbitrary_expression_in_pattern) ]
368
368
pub struct ArbitraryExpressionInPattern {
369
369
#[ primary_span]
370
370
pub span : Span ,
371
371
}
372
372
373
- #[ derive( Diagnostic , Clone , Copy ) ]
373
+ #[ derive( Diagnostic ) ]
374
374
#[ diag( ast_lowering_inclusive_range_with_no_end) ]
375
375
pub struct InclusiveRangeWithNoEnd {
376
376
#[ primary_span]
0 commit comments