@@ -6,7 +6,7 @@ use rustc_span::{Span, Symbol};
6
6
7
7
#[ derive( Diagnostic ) ]
8
8
#[ diag( ast_lowering_generic_type_with_parentheses, code = E0214 ) ]
9
- pub struct GenericTypeWithParentheses {
9
+ pub ( crate ) struct GenericTypeWithParentheses {
10
10
#[ primary_span]
11
11
#[ label]
12
12
pub span : Span ,
@@ -16,7 +16,7 @@ pub struct GenericTypeWithParentheses {
16
16
17
17
#[ derive( Subdiagnostic ) ]
18
18
#[ multipart_suggestion( ast_lowering_use_angle_brackets, applicability = "maybe-incorrect" ) ]
19
- pub struct UseAngleBrackets {
19
+ pub ( crate ) struct UseAngleBrackets {
20
20
#[ suggestion_part( code = "<" ) ]
21
21
pub open_param : Span ,
22
22
#[ suggestion_part( code = ">" ) ]
@@ -26,7 +26,7 @@ pub struct UseAngleBrackets {
26
26
#[ derive( Diagnostic ) ]
27
27
#[ diag( ast_lowering_invalid_abi, code = E0703 ) ]
28
28
#[ note]
29
- pub struct InvalidAbi {
29
+ pub ( crate ) struct InvalidAbi {
30
30
#[ primary_span]
31
31
#[ label]
32
32
pub span : Span ,
@@ -38,7 +38,7 @@ pub struct InvalidAbi {
38
38
pub suggestion : Option < InvalidAbiSuggestion > ,
39
39
}
40
40
41
- pub struct InvalidAbiReason ( pub & ' static str ) ;
41
+ pub ( crate ) struct InvalidAbiReason ( pub & ' static str ) ;
42
42
43
43
impl Subdiagnostic for InvalidAbiReason {
44
44
fn add_to_diag_with < G : EmissionGuarantee , F : SubdiagMessageOp < G > > (
@@ -57,23 +57,23 @@ impl Subdiagnostic for InvalidAbiReason {
57
57
code = "{suggestion}" ,
58
58
applicability = "maybe-incorrect"
59
59
) ]
60
- pub struct InvalidAbiSuggestion {
60
+ pub ( crate ) struct InvalidAbiSuggestion {
61
61
#[ primary_span]
62
62
pub span : Span ,
63
63
pub suggestion : String ,
64
64
}
65
65
66
66
#[ derive( Diagnostic ) ]
67
67
#[ diag( ast_lowering_assoc_ty_parentheses) ]
68
- pub struct AssocTyParentheses {
68
+ pub ( crate ) struct AssocTyParentheses {
69
69
#[ primary_span]
70
70
pub span : Span ,
71
71
#[ subdiagnostic]
72
72
pub sub : AssocTyParenthesesSub ,
73
73
}
74
74
75
75
#[ derive( Subdiagnostic ) ]
76
- pub enum AssocTyParenthesesSub {
76
+ pub ( crate ) enum AssocTyParenthesesSub {
77
77
#[ multipart_suggestion( ast_lowering_remove_parentheses) ]
78
78
Empty {
79
79
#[ suggestion_part( code = "" ) ]
@@ -91,15 +91,15 @@ pub enum AssocTyParenthesesSub {
91
91
#[ derive( Diagnostic ) ]
92
92
#[ diag( ast_lowering_misplaced_impl_trait, code = E0562 ) ]
93
93
#[ note]
94
- pub struct MisplacedImplTrait < ' a > {
94
+ pub ( crate ) struct MisplacedImplTrait < ' a > {
95
95
#[ primary_span]
96
96
pub span : Span ,
97
97
pub position : DiagArgFromDisplay < ' a > ,
98
98
}
99
99
100
100
#[ derive( Diagnostic ) ]
101
101
#[ diag( ast_lowering_assoc_ty_binding_in_dyn) ]
102
- pub struct MisplacedAssocTyBinding {
102
+ pub ( crate ) struct MisplacedAssocTyBinding {
103
103
#[ primary_span]
104
104
pub span : Span ,
105
105
#[ suggestion( code = " = impl" , applicability = "maybe-incorrect" , style = "verbose" ) ]
@@ -108,23 +108,23 @@ pub struct MisplacedAssocTyBinding {
108
108
109
109
#[ derive( Diagnostic ) ]
110
110
#[ diag( ast_lowering_underscore_expr_lhs_assign) ]
111
- pub struct UnderscoreExprLhsAssign {
111
+ pub ( crate ) struct UnderscoreExprLhsAssign {
112
112
#[ primary_span]
113
113
#[ label]
114
114
pub span : Span ,
115
115
}
116
116
117
117
#[ derive( Diagnostic ) ]
118
118
#[ diag( ast_lowering_base_expression_double_dot, code = E0797 ) ]
119
- pub struct BaseExpressionDoubleDot {
119
+ pub ( crate ) 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
125
#[ derive( Diagnostic ) ]
126
126
#[ diag( ast_lowering_await_only_in_async_fn_and_blocks, code = E0728 ) ]
127
- pub struct AwaitOnlyInAsyncFnAndBlocks {
127
+ pub ( crate ) struct AwaitOnlyInAsyncFnAndBlocks {
128
128
#[ primary_span]
129
129
#[ label]
130
130
pub await_kw_span : Span ,
@@ -134,50 +134,50 @@ pub struct AwaitOnlyInAsyncFnAndBlocks {
134
134
135
135
#[ derive( Diagnostic ) ]
136
136
#[ diag( ast_lowering_coroutine_too_many_parameters, code = E0628 ) ]
137
- pub struct CoroutineTooManyParameters {
137
+ pub ( crate ) struct CoroutineTooManyParameters {
138
138
#[ primary_span]
139
139
pub fn_decl_span : Span ,
140
140
}
141
141
142
142
#[ derive( Diagnostic ) ]
143
143
#[ diag( ast_lowering_closure_cannot_be_static, code = E0697 ) ]
144
- pub struct ClosureCannotBeStatic {
144
+ pub ( crate ) struct ClosureCannotBeStatic {
145
145
#[ primary_span]
146
146
pub fn_decl_span : Span ,
147
147
}
148
148
149
149
#[ derive( Diagnostic ) ]
150
150
#[ diag( ast_lowering_functional_record_update_destructuring_assignment) ]
151
- pub struct FunctionalRecordUpdateDestructuringAssignment {
151
+ pub ( crate ) struct FunctionalRecordUpdateDestructuringAssignment {
152
152
#[ primary_span]
153
153
#[ suggestion( code = "" , applicability = "machine-applicable" ) ]
154
154
pub span : Span ,
155
155
}
156
156
157
157
#[ derive( Diagnostic ) ]
158
158
#[ diag( ast_lowering_async_coroutines_not_supported, code = E0727 ) ]
159
- pub struct AsyncCoroutinesNotSupported {
159
+ pub ( crate ) struct AsyncCoroutinesNotSupported {
160
160
#[ primary_span]
161
161
pub span : Span ,
162
162
}
163
163
164
164
#[ derive( Diagnostic ) ]
165
165
#[ diag( ast_lowering_inline_asm_unsupported_target, code = E0472 ) ]
166
- pub struct InlineAsmUnsupportedTarget {
166
+ pub ( crate ) struct InlineAsmUnsupportedTarget {
167
167
#[ primary_span]
168
168
pub span : Span ,
169
169
}
170
170
171
171
#[ derive( Diagnostic ) ]
172
172
#[ diag( ast_lowering_att_syntax_only_x86) ]
173
- pub struct AttSyntaxOnlyX86 {
173
+ pub ( crate ) struct AttSyntaxOnlyX86 {
174
174
#[ primary_span]
175
175
pub span : Span ,
176
176
}
177
177
178
178
#[ derive( Diagnostic ) ]
179
179
#[ diag( ast_lowering_abi_specified_multiple_times) ]
180
- pub struct AbiSpecifiedMultipleTimes {
180
+ pub ( crate ) struct AbiSpecifiedMultipleTimes {
181
181
#[ primary_span]
182
182
pub abi_span : Span ,
183
183
pub prev_name : Symbol ,
@@ -189,23 +189,23 @@ pub struct AbiSpecifiedMultipleTimes {
189
189
190
190
#[ derive( Diagnostic ) ]
191
191
#[ diag( ast_lowering_clobber_abi_not_supported) ]
192
- pub struct ClobberAbiNotSupported {
192
+ pub ( crate ) struct ClobberAbiNotSupported {
193
193
#[ primary_span]
194
194
pub abi_span : Span ,
195
195
}
196
196
197
197
#[ derive( Diagnostic ) ]
198
198
#[ note]
199
199
#[ diag( ast_lowering_invalid_abi_clobber_abi) ]
200
- pub struct InvalidAbiClobberAbi {
200
+ pub ( crate ) struct InvalidAbiClobberAbi {
201
201
#[ primary_span]
202
202
pub abi_span : Span ,
203
203
pub supported_abis : String ,
204
204
}
205
205
206
206
#[ derive( Diagnostic ) ]
207
207
#[ diag( ast_lowering_invalid_register) ]
208
- pub struct InvalidRegister < ' a > {
208
+ pub ( crate ) struct InvalidRegister < ' a > {
209
209
#[ primary_span]
210
210
pub op_span : Span ,
211
211
pub reg : Symbol ,
@@ -214,7 +214,7 @@ pub struct InvalidRegister<'a> {
214
214
215
215
#[ derive( Diagnostic ) ]
216
216
#[ diag( ast_lowering_invalid_register_class) ]
217
- pub struct InvalidRegisterClass < ' a > {
217
+ pub ( crate ) struct InvalidRegisterClass < ' a > {
218
218
#[ primary_span]
219
219
pub op_span : Span ,
220
220
pub reg_class : Symbol ,
@@ -223,7 +223,7 @@ pub struct InvalidRegisterClass<'a> {
223
223
224
224
#[ derive( Diagnostic ) ]
225
225
#[ diag( ast_lowering_invalid_asm_template_modifier_reg_class) ]
226
- pub struct InvalidAsmTemplateModifierRegClass {
226
+ pub ( crate ) struct InvalidAsmTemplateModifierRegClass {
227
227
#[ primary_span]
228
228
#[ label( ast_lowering_template_modifier) ]
229
229
pub placeholder_span : Span ,
@@ -234,7 +234,7 @@ pub struct InvalidAsmTemplateModifierRegClass {
234
234
}
235
235
236
236
#[ derive( Subdiagnostic ) ]
237
- pub enum InvalidAsmTemplateModifierRegClassSub {
237
+ pub ( crate ) enum InvalidAsmTemplateModifierRegClassSub {
238
238
#[ note( ast_lowering_support_modifiers) ]
239
239
SupportModifier { class_name : Symbol , modifiers : String } ,
240
240
#[ note( ast_lowering_does_not_support_modifiers) ]
@@ -243,7 +243,7 @@ pub enum InvalidAsmTemplateModifierRegClassSub {
243
243
244
244
#[ derive( Diagnostic ) ]
245
245
#[ diag( ast_lowering_invalid_asm_template_modifier_const) ]
246
- pub struct InvalidAsmTemplateModifierConst {
246
+ pub ( crate ) struct InvalidAsmTemplateModifierConst {
247
247
#[ primary_span]
248
248
#[ label( ast_lowering_template_modifier) ]
249
249
pub placeholder_span : Span ,
@@ -253,7 +253,7 @@ pub struct InvalidAsmTemplateModifierConst {
253
253
254
254
#[ derive( Diagnostic ) ]
255
255
#[ diag( ast_lowering_invalid_asm_template_modifier_sym) ]
256
- pub struct InvalidAsmTemplateModifierSym {
256
+ pub ( crate ) struct InvalidAsmTemplateModifierSym {
257
257
#[ primary_span]
258
258
#[ label( ast_lowering_template_modifier) ]
259
259
pub placeholder_span : Span ,
@@ -263,7 +263,7 @@ pub struct InvalidAsmTemplateModifierSym {
263
263
264
264
#[ derive( Diagnostic ) ]
265
265
#[ diag( ast_lowering_invalid_asm_template_modifier_label) ]
266
- pub struct InvalidAsmTemplateModifierLabel {
266
+ pub ( crate ) struct InvalidAsmTemplateModifierLabel {
267
267
#[ primary_span]
268
268
#[ label( ast_lowering_template_modifier) ]
269
269
pub placeholder_span : Span ,
@@ -273,15 +273,15 @@ pub struct InvalidAsmTemplateModifierLabel {
273
273
274
274
#[ derive( Diagnostic ) ]
275
275
#[ diag( ast_lowering_register_class_only_clobber) ]
276
- pub struct RegisterClassOnlyClobber {
276
+ pub ( crate ) struct RegisterClassOnlyClobber {
277
277
#[ primary_span]
278
278
pub op_span : Span ,
279
279
pub reg_class_name : Symbol ,
280
280
}
281
281
282
282
#[ derive( Diagnostic ) ]
283
283
#[ diag( ast_lowering_register_conflict) ]
284
- pub struct RegisterConflict < ' a > {
284
+ pub ( crate ) struct RegisterConflict < ' a > {
285
285
#[ primary_span]
286
286
#[ label( ast_lowering_register1) ]
287
287
pub op_span1 : Span ,
@@ -296,7 +296,7 @@ pub struct RegisterConflict<'a> {
296
296
#[ derive( Diagnostic ) ]
297
297
#[ help]
298
298
#[ diag( ast_lowering_sub_tuple_binding) ]
299
- pub struct SubTupleBinding < ' a > {
299
+ pub ( crate ) struct SubTupleBinding < ' a > {
300
300
#[ primary_span]
301
301
#[ label]
302
302
#[ suggestion(
@@ -313,7 +313,7 @@ pub struct SubTupleBinding<'a> {
313
313
314
314
#[ derive( Diagnostic ) ]
315
315
#[ diag( ast_lowering_extra_double_dot) ]
316
- pub struct ExtraDoubleDot < ' a > {
316
+ pub ( crate ) struct ExtraDoubleDot < ' a > {
317
317
#[ primary_span]
318
318
#[ label]
319
319
pub span : Span ,
@@ -325,21 +325,21 @@ pub struct ExtraDoubleDot<'a> {
325
325
#[ derive( Diagnostic ) ]
326
326
#[ note]
327
327
#[ diag( ast_lowering_misplaced_double_dot) ]
328
- pub struct MisplacedDoubleDot {
328
+ pub ( crate ) struct MisplacedDoubleDot {
329
329
#[ primary_span]
330
330
pub span : Span ,
331
331
}
332
332
333
333
#[ derive( Diagnostic ) ]
334
334
#[ diag( ast_lowering_misplaced_relax_trait_bound) ]
335
- pub struct MisplacedRelaxTraitBound {
335
+ pub ( crate ) struct MisplacedRelaxTraitBound {
336
336
#[ primary_span]
337
337
pub span : Span ,
338
338
}
339
339
340
340
#[ derive( Diagnostic ) ]
341
341
#[ diag( ast_lowering_match_arm_with_no_body) ]
342
- pub struct MatchArmWithNoBody {
342
+ pub ( crate ) struct MatchArmWithNoBody {
343
343
#[ primary_span]
344
344
pub span : Span ,
345
345
#[ suggestion( code = " => todo!()," , applicability = "has-placeholders" ) ]
@@ -348,7 +348,7 @@ pub struct MatchArmWithNoBody {
348
348
349
349
#[ derive( Diagnostic ) ]
350
350
#[ diag( ast_lowering_never_pattern_with_body) ]
351
- pub struct NeverPatternWithBody {
351
+ pub ( crate ) struct NeverPatternWithBody {
352
352
#[ primary_span]
353
353
#[ label]
354
354
#[ suggestion( code = "" , applicability = "maybe-incorrect" ) ]
@@ -357,15 +357,15 @@ pub struct NeverPatternWithBody {
357
357
358
358
#[ derive( Diagnostic ) ]
359
359
#[ diag( ast_lowering_never_pattern_with_guard) ]
360
- pub struct NeverPatternWithGuard {
360
+ pub ( crate ) struct NeverPatternWithGuard {
361
361
#[ primary_span]
362
362
#[ suggestion( code = "" , applicability = "maybe-incorrect" ) ]
363
363
pub span : Span ,
364
364
}
365
365
366
366
#[ derive( Diagnostic ) ]
367
367
#[ diag( ast_lowering_arbitrary_expression_in_pattern) ]
368
- pub struct ArbitraryExpressionInPattern {
368
+ pub ( crate ) struct ArbitraryExpressionInPattern {
369
369
#[ primary_span]
370
370
pub span : Span ,
371
371
#[ note( ast_lowering_pattern_from_macro_note) ]
@@ -374,13 +374,13 @@ pub struct ArbitraryExpressionInPattern {
374
374
375
375
#[ derive( Diagnostic ) ]
376
376
#[ diag( ast_lowering_inclusive_range_with_no_end) ]
377
- pub struct InclusiveRangeWithNoEnd {
377
+ pub ( crate ) struct InclusiveRangeWithNoEnd {
378
378
#[ primary_span]
379
379
pub span : Span ,
380
380
}
381
381
382
382
#[ derive( Diagnostic ) ]
383
- pub enum BadReturnTypeNotation {
383
+ pub ( crate ) enum BadReturnTypeNotation {
384
384
#[ diag( ast_lowering_bad_return_type_notation_inputs) ]
385
385
Inputs {
386
386
#[ primary_span]
0 commit comments