1
1
use rustc_errors:: { fluent, AddSubdiagnostic , Applicability , Diagnostic , DiagnosticArgFromDisplay } ;
2
- use rustc_macros:: { SessionDiagnostic , SessionSubdiagnostic } ;
2
+ use rustc_macros:: { DiagnosticHandler , SessionSubdiagnostic } ;
3
3
use rustc_span:: { symbol:: Ident , Span , Symbol } ;
4
4
5
- #[ derive( SessionDiagnostic , Clone , Copy ) ]
5
+ #[ derive( DiagnosticHandler , Clone , Copy ) ]
6
6
#[ diag( ast_lowering:: generic_type_with_parentheses, code = "E0214" ) ]
7
7
pub struct GenericTypeWithParentheses {
8
8
#[ primary_span]
@@ -28,7 +28,7 @@ impl AddSubdiagnostic for UseAngleBrackets {
28
28
}
29
29
}
30
30
31
- #[ derive( SessionDiagnostic ) ]
31
+ #[ derive( DiagnosticHandler ) ]
32
32
#[ help]
33
33
#[ diag( ast_lowering:: invalid_abi, code = "E0703" ) ]
34
34
pub struct InvalidAbi {
@@ -39,7 +39,7 @@ pub struct InvalidAbi {
39
39
pub valid_abis : String ,
40
40
}
41
41
42
- #[ derive( SessionDiagnostic , Clone , Copy ) ]
42
+ #[ derive( DiagnosticHandler , Clone , Copy ) ]
43
43
#[ diag( ast_lowering:: assoc_ty_parentheses) ]
44
44
pub struct AssocTyParentheses {
45
45
#[ primary_span]
@@ -71,38 +71,38 @@ impl AddSubdiagnostic for AssocTyParenthesesSub {
71
71
}
72
72
}
73
73
74
- #[ derive( SessionDiagnostic ) ]
74
+ #[ derive( DiagnosticHandler ) ]
75
75
#[ diag( ast_lowering:: misplaced_impl_trait, code = "E0562" ) ]
76
76
pub struct MisplacedImplTrait < ' a > {
77
77
#[ primary_span]
78
78
pub span : Span ,
79
79
pub position : DiagnosticArgFromDisplay < ' a > ,
80
80
}
81
81
82
- #[ derive( SessionDiagnostic , Clone , Copy ) ]
82
+ #[ derive( DiagnosticHandler , Clone , Copy ) ]
83
83
#[ diag( ast_lowering:: rustc_box_attribute_error) ]
84
84
pub struct RustcBoxAttributeError {
85
85
#[ primary_span]
86
86
pub span : Span ,
87
87
}
88
88
89
- #[ derive( SessionDiagnostic , Clone , Copy ) ]
89
+ #[ derive( DiagnosticHandler , Clone , Copy ) ]
90
90
#[ diag( ast_lowering:: underscore_expr_lhs_assign) ]
91
91
pub struct UnderscoreExprLhsAssign {
92
92
#[ primary_span]
93
93
#[ label]
94
94
pub span : Span ,
95
95
}
96
96
97
- #[ derive( SessionDiagnostic , Clone , Copy ) ]
97
+ #[ derive( DiagnosticHandler , Clone , Copy ) ]
98
98
#[ diag( ast_lowering:: base_expression_double_dot) ]
99
99
pub struct BaseExpressionDoubleDot {
100
100
#[ primary_span]
101
101
#[ label]
102
102
pub span : Span ,
103
103
}
104
104
105
- #[ derive( SessionDiagnostic , Clone , Copy ) ]
105
+ #[ derive( DiagnosticHandler , Clone , Copy ) ]
106
106
#[ diag( ast_lowering:: await_only_in_async_fn_and_blocks, code = "E0728" ) ]
107
107
pub struct AwaitOnlyInAsyncFnAndBlocks {
108
108
#[ primary_span]
@@ -112,58 +112,58 @@ pub struct AwaitOnlyInAsyncFnAndBlocks {
112
112
pub item_span : Option < Span > ,
113
113
}
114
114
115
- #[ derive( SessionDiagnostic , Clone , Copy ) ]
115
+ #[ derive( DiagnosticHandler , Clone , Copy ) ]
116
116
#[ diag( ast_lowering:: generator_too_many_parameters, code = "E0628" ) ]
117
117
pub struct GeneratorTooManyParameters {
118
118
#[ primary_span]
119
119
pub fn_decl_span : Span ,
120
120
}
121
121
122
- #[ derive( SessionDiagnostic , Clone , Copy ) ]
122
+ #[ derive( DiagnosticHandler , Clone , Copy ) ]
123
123
#[ diag( ast_lowering:: closure_cannot_be_static, code = "E0697" ) ]
124
124
pub struct ClosureCannotBeStatic {
125
125
#[ primary_span]
126
126
pub fn_decl_span : Span ,
127
127
}
128
128
129
- #[ derive( SessionDiagnostic , Clone , Copy ) ]
129
+ #[ derive( DiagnosticHandler , Clone , Copy ) ]
130
130
#[ help]
131
131
#[ diag( ast_lowering:: async_non_move_closure_not_supported, code = "E0708" ) ]
132
132
pub struct AsyncNonMoveClosureNotSupported {
133
133
#[ primary_span]
134
134
pub fn_decl_span : Span ,
135
135
}
136
136
137
- #[ derive( SessionDiagnostic , Clone , Copy ) ]
137
+ #[ derive( DiagnosticHandler , Clone , Copy ) ]
138
138
#[ diag( ast_lowering:: functional_record_update_destructuring_assignment) ]
139
139
pub struct FunctionalRecordUpdateDestructuringAssignemnt {
140
140
#[ primary_span]
141
141
#[ suggestion( code = "" , applicability = "machine-applicable" ) ]
142
142
pub span : Span ,
143
143
}
144
144
145
- #[ derive( SessionDiagnostic , Clone , Copy ) ]
145
+ #[ derive( DiagnosticHandler , Clone , Copy ) ]
146
146
#[ diag( ast_lowering:: async_generators_not_supported, code = "E0727" ) ]
147
147
pub struct AsyncGeneratorsNotSupported {
148
148
#[ primary_span]
149
149
pub span : Span ,
150
150
}
151
151
152
- #[ derive( SessionDiagnostic , Clone , Copy ) ]
152
+ #[ derive( DiagnosticHandler , Clone , Copy ) ]
153
153
#[ diag( ast_lowering:: inline_asm_unsupported_target, code = "E0472" ) ]
154
154
pub struct InlineAsmUnsupportedTarget {
155
155
#[ primary_span]
156
156
pub span : Span ,
157
157
}
158
158
159
- #[ derive( SessionDiagnostic , Clone , Copy ) ]
159
+ #[ derive( DiagnosticHandler , Clone , Copy ) ]
160
160
#[ diag( ast_lowering:: att_syntax_only_x86) ]
161
161
pub struct AttSyntaxOnlyX86 {
162
162
#[ primary_span]
163
163
pub span : Span ,
164
164
}
165
165
166
- #[ derive( SessionDiagnostic , Clone , Copy ) ]
166
+ #[ derive( DiagnosticHandler , Clone , Copy ) ]
167
167
#[ diag( ast_lowering:: abi_specified_multiple_times) ]
168
168
pub struct AbiSpecifiedMultipleTimes {
169
169
#[ primary_span]
@@ -175,14 +175,14 @@ pub struct AbiSpecifiedMultipleTimes {
175
175
pub equivalent : Option < ( ) > ,
176
176
}
177
177
178
- #[ derive( SessionDiagnostic , Clone , Copy ) ]
178
+ #[ derive( DiagnosticHandler , Clone , Copy ) ]
179
179
#[ diag( ast_lowering:: clobber_abi_not_supported) ]
180
180
pub struct ClobberAbiNotSupported {
181
181
#[ primary_span]
182
182
pub abi_span : Span ,
183
183
}
184
184
185
- #[ derive( SessionDiagnostic ) ]
185
+ #[ derive( DiagnosticHandler ) ]
186
186
#[ note]
187
187
#[ diag( ast_lowering:: invalid_abi_clobber_abi) ]
188
188
pub struct InvalidAbiClobberAbi {
@@ -191,7 +191,7 @@ pub struct InvalidAbiClobberAbi {
191
191
pub supported_abis : String ,
192
192
}
193
193
194
- #[ derive( SessionDiagnostic , Clone , Copy ) ]
194
+ #[ derive( DiagnosticHandler , Clone , Copy ) ]
195
195
#[ diag( ast_lowering:: invalid_register) ]
196
196
pub struct InvalidRegister < ' a > {
197
197
#[ primary_span]
@@ -200,7 +200,7 @@ pub struct InvalidRegister<'a> {
200
200
pub error : & ' a str ,
201
201
}
202
202
203
- #[ derive( SessionDiagnostic , Clone , Copy ) ]
203
+ #[ derive( DiagnosticHandler , Clone , Copy ) ]
204
204
#[ diag( ast_lowering:: invalid_register_class) ]
205
205
pub struct InvalidRegisterClass < ' a > {
206
206
#[ primary_span]
@@ -209,7 +209,7 @@ pub struct InvalidRegisterClass<'a> {
209
209
pub error : & ' a str ,
210
210
}
211
211
212
- #[ derive( SessionDiagnostic ) ]
212
+ #[ derive( DiagnosticHandler ) ]
213
213
#[ diag( ast_lowering:: invalid_asm_template_modifier_reg_class) ]
214
214
pub struct InvalidAsmTemplateModifierRegClass {
215
215
#[ primary_span]
@@ -229,7 +229,7 @@ pub enum InvalidAsmTemplateModifierRegClassSub {
229
229
DoesNotSupportModifier { class_name : Symbol } ,
230
230
}
231
231
232
- #[ derive( SessionDiagnostic , Clone , Copy ) ]
232
+ #[ derive( DiagnosticHandler , Clone , Copy ) ]
233
233
#[ diag( ast_lowering:: invalid_asm_template_modifier_const) ]
234
234
pub struct InvalidAsmTemplateModifierConst {
235
235
#[ primary_span]
@@ -239,7 +239,7 @@ pub struct InvalidAsmTemplateModifierConst {
239
239
pub op_span : Span ,
240
240
}
241
241
242
- #[ derive( SessionDiagnostic , Clone , Copy ) ]
242
+ #[ derive( DiagnosticHandler , Clone , Copy ) ]
243
243
#[ diag( ast_lowering:: invalid_asm_template_modifier_sym) ]
244
244
pub struct InvalidAsmTemplateModifierSym {
245
245
#[ primary_span]
@@ -249,15 +249,15 @@ pub struct InvalidAsmTemplateModifierSym {
249
249
pub op_span : Span ,
250
250
}
251
251
252
- #[ derive( SessionDiagnostic , Clone , Copy ) ]
252
+ #[ derive( DiagnosticHandler , Clone , Copy ) ]
253
253
#[ diag( ast_lowering:: register_class_only_clobber) ]
254
254
pub struct RegisterClassOnlyClobber {
255
255
#[ primary_span]
256
256
pub op_span : Span ,
257
257
pub reg_class_name : Symbol ,
258
258
}
259
259
260
- #[ derive( SessionDiagnostic , Clone , Copy ) ]
260
+ #[ derive( DiagnosticHandler , Clone , Copy ) ]
261
261
#[ diag( ast_lowering:: register_conflict) ]
262
262
pub struct RegisterConflict < ' a > {
263
263
#[ primary_span]
@@ -271,7 +271,7 @@ pub struct RegisterConflict<'a> {
271
271
pub in_out : Option < Span > ,
272
272
}
273
273
274
- #[ derive( SessionDiagnostic , Clone , Copy ) ]
274
+ #[ derive( DiagnosticHandler , Clone , Copy ) ]
275
275
#[ help]
276
276
#[ diag( ast_lowering:: sub_tuple_binding) ]
277
277
pub struct SubTupleBinding < ' a > {
@@ -288,7 +288,7 @@ pub struct SubTupleBinding<'a> {
288
288
pub ctx : & ' a str ,
289
289
}
290
290
291
- #[ derive( SessionDiagnostic , Clone , Copy ) ]
291
+ #[ derive( DiagnosticHandler , Clone , Copy ) ]
292
292
#[ diag( ast_lowering:: extra_double_dot) ]
293
293
pub struct ExtraDoubleDot < ' a > {
294
294
#[ primary_span]
@@ -299,36 +299,36 @@ pub struct ExtraDoubleDot<'a> {
299
299
pub ctx : & ' a str ,
300
300
}
301
301
302
- #[ derive( SessionDiagnostic , Clone , Copy ) ]
302
+ #[ derive( DiagnosticHandler , Clone , Copy ) ]
303
303
#[ note]
304
304
#[ diag( ast_lowering:: misplaced_double_dot) ]
305
305
pub struct MisplacedDoubleDot {
306
306
#[ primary_span]
307
307
pub span : Span ,
308
308
}
309
309
310
- #[ derive( SessionDiagnostic , Clone , Copy ) ]
310
+ #[ derive( DiagnosticHandler , Clone , Copy ) ]
311
311
#[ diag( ast_lowering:: misplaced_relax_trait_bound) ]
312
312
pub struct MisplacedRelaxTraitBound {
313
313
#[ primary_span]
314
314
pub span : Span ,
315
315
}
316
316
317
- #[ derive( SessionDiagnostic , Clone , Copy ) ]
317
+ #[ derive( DiagnosticHandler , Clone , Copy ) ]
318
318
#[ diag( ast_lowering:: not_supported_for_lifetime_binder_async_closure) ]
319
319
pub struct NotSupportedForLifetimeBinderAsyncClosure {
320
320
#[ primary_span]
321
321
pub span : Span ,
322
322
}
323
323
324
- #[ derive( SessionDiagnostic , Clone , Copy ) ]
324
+ #[ derive( DiagnosticHandler , Clone , Copy ) ]
325
325
#[ diag( ast_lowering:: arbitrary_expression_in_pattern) ]
326
326
pub struct ArbitraryExpressionInPattern {
327
327
#[ primary_span]
328
328
pub span : Span ,
329
329
}
330
330
331
- #[ derive( SessionDiagnostic , Clone , Copy ) ]
331
+ #[ derive( DiagnosticHandler , Clone , Copy ) ]
332
332
#[ diag( ast_lowering:: inclusive_range_with_no_end) ]
333
333
pub struct InclusiveRangeWithNoEnd {
334
334
#[ primary_span]
0 commit comments