@@ -12,39 +12,39 @@ use crate::UnsupportedLiteralReason;
12
12
#[ diag( attr_expected_one_cfg_pattern, code = E0536 ) ]
13
13
pub ( crate ) struct ExpectedOneCfgPattern {
14
14
#[ primary_span]
15
- pub span : Span ,
15
+ pub ( crate ) span : Span ,
16
16
}
17
17
18
18
#[ derive( Diagnostic ) ]
19
19
#[ diag( attr_invalid_predicate, code = E0537 ) ]
20
20
pub ( crate ) struct InvalidPredicate {
21
21
#[ primary_span]
22
- pub span : Span ,
22
+ pub ( crate ) span : Span ,
23
23
24
- pub predicate : String ,
24
+ pub ( crate ) predicate : String ,
25
25
}
26
26
27
27
#[ derive( Diagnostic ) ]
28
28
#[ diag( attr_multiple_item, code = E0538 ) ]
29
29
pub ( crate ) struct MultipleItem {
30
30
#[ primary_span]
31
- pub span : Span ,
31
+ pub ( crate ) span : Span ,
32
32
33
- pub item : String ,
33
+ pub ( crate ) item : String ,
34
34
}
35
35
36
36
#[ derive( Diagnostic ) ]
37
37
#[ diag( attr_incorrect_meta_item, code = E0539 ) ]
38
38
pub ( crate ) struct IncorrectMetaItem {
39
39
#[ primary_span]
40
- pub span : Span ,
40
+ pub ( crate ) span : Span ,
41
41
}
42
42
43
43
/// Error code: E0541
44
44
pub ( crate ) struct UnknownMetaItem < ' a > {
45
- pub span : Span ,
46
- pub item : String ,
47
- pub expected : & ' a [ & ' a str ] ,
45
+ pub ( crate ) span : Span ,
46
+ pub ( crate ) item : String ,
47
+ pub ( crate ) expected : & ' a [ & ' a str ] ,
48
48
}
49
49
50
50
// Manual implementation to be able to format `expected` items correctly.
@@ -64,31 +64,31 @@ impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for UnknownMetaItem<'_> {
64
64
#[ diag( attr_missing_since, code = E0542 ) ]
65
65
pub ( crate ) struct MissingSince {
66
66
#[ primary_span]
67
- pub span : Span ,
67
+ pub ( crate ) span : Span ,
68
68
}
69
69
70
70
#[ derive( Diagnostic ) ]
71
71
#[ diag( attr_missing_note, code = E0543 ) ]
72
72
pub ( crate ) struct MissingNote {
73
73
#[ primary_span]
74
- pub span : Span ,
74
+ pub ( crate ) span : Span ,
75
75
}
76
76
77
77
#[ derive( Diagnostic ) ]
78
78
#[ diag( attr_multiple_stability_levels, code = E0544 ) ]
79
79
pub ( crate ) struct MultipleStabilityLevels {
80
80
#[ primary_span]
81
- pub span : Span ,
81
+ pub ( crate ) span : Span ,
82
82
}
83
83
84
84
#[ derive( Diagnostic ) ]
85
85
#[ diag( attr_invalid_issue_string, code = E0545 ) ]
86
86
pub ( crate ) struct InvalidIssueString {
87
87
#[ primary_span]
88
- pub span : Span ,
88
+ pub ( crate ) span : Span ,
89
89
90
90
#[ subdiagnostic]
91
- pub cause : Option < InvalidIssueStringCause > ,
91
+ pub ( crate ) cause : Option < InvalidIssueStringCause > ,
92
92
}
93
93
94
94
// The error kinds of `IntErrorKind` are duplicated here in order to allow the messages to be
@@ -127,7 +127,7 @@ pub(crate) enum InvalidIssueStringCause {
127
127
}
128
128
129
129
impl InvalidIssueStringCause {
130
- pub fn from_int_error_kind ( span : Span , kind : & IntErrorKind ) -> Option < Self > {
130
+ pub ( crate ) fn from_int_error_kind ( span : Span , kind : & IntErrorKind ) -> Option < Self > {
131
131
match kind {
132
132
IntErrorKind :: Empty => Some ( Self :: Empty { span } ) ,
133
133
IntErrorKind :: InvalidDigit => Some ( Self :: InvalidDigit { span } ) ,
@@ -143,21 +143,21 @@ impl InvalidIssueStringCause {
143
143
#[ diag( attr_missing_feature, code = E0546 ) ]
144
144
pub ( crate ) struct MissingFeature {
145
145
#[ primary_span]
146
- pub span : Span ,
146
+ pub ( crate ) span : Span ,
147
147
}
148
148
149
149
#[ derive( Diagnostic ) ]
150
150
#[ diag( attr_non_ident_feature, code = E0546 ) ]
151
151
pub ( crate ) struct NonIdentFeature {
152
152
#[ primary_span]
153
- pub span : Span ,
153
+ pub ( crate ) span : Span ,
154
154
}
155
155
156
156
#[ derive( Diagnostic ) ]
157
157
#[ diag( attr_missing_issue, code = E0547 ) ]
158
158
pub ( crate ) struct MissingIssue {
159
159
#[ primary_span]
160
- pub span : Span ,
160
+ pub ( crate ) span : Span ,
161
161
}
162
162
163
163
// FIXME: Why is this the same error code as `InvalidReprHintNoParen` and `InvalidReprHintNoValue`?
@@ -166,39 +166,39 @@ pub(crate) struct MissingIssue {
166
166
#[ diag( attr_incorrect_repr_format_packed_one_or_zero_arg, code = E0552 ) ]
167
167
pub ( crate ) struct IncorrectReprFormatPackedOneOrZeroArg {
168
168
#[ primary_span]
169
- pub span : Span ,
169
+ pub ( crate ) span : Span ,
170
170
}
171
171
#[ derive( Diagnostic ) ]
172
172
#[ diag( attr_incorrect_repr_format_packed_expect_integer, code = E0552 ) ]
173
173
pub ( crate ) struct IncorrectReprFormatPackedExpectInteger {
174
174
#[ primary_span]
175
- pub span : Span ,
175
+ pub ( crate ) span : Span ,
176
176
}
177
177
178
178
#[ derive( Diagnostic ) ]
179
179
#[ diag( attr_invalid_repr_hint_no_paren, code = E0552 ) ]
180
180
pub ( crate ) struct InvalidReprHintNoParen {
181
181
#[ primary_span]
182
- pub span : Span ,
182
+ pub ( crate ) span : Span ,
183
183
184
- pub name : String ,
184
+ pub ( crate ) name : String ,
185
185
}
186
186
187
187
#[ derive( Diagnostic ) ]
188
188
#[ diag( attr_invalid_repr_hint_no_value, code = E0552 ) ]
189
189
pub ( crate ) struct InvalidReprHintNoValue {
190
190
#[ primary_span]
191
- pub span : Span ,
191
+ pub ( crate ) span : Span ,
192
192
193
- pub name : String ,
193
+ pub ( crate ) name : String ,
194
194
}
195
195
196
196
/// Error code: E0565
197
197
pub ( crate ) struct UnsupportedLiteral {
198
- pub span : Span ,
199
- pub reason : UnsupportedLiteralReason ,
200
- pub is_bytestr : bool ,
201
- pub start_point_span : Span ,
198
+ pub ( crate ) span : Span ,
199
+ pub ( crate ) reason : UnsupportedLiteralReason ,
200
+ pub ( crate ) is_bytestr : bool ,
201
+ pub ( crate ) start_point_span : Span ,
202
202
}
203
203
204
204
impl < ' a , G : EmissionGuarantee > Diagnostic < ' a , G > for UnsupportedLiteral {
@@ -236,43 +236,43 @@ impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for UnsupportedLiteral {
236
236
pub ( crate ) struct InvalidReprAlignNeedArg {
237
237
#[ primary_span]
238
238
#[ suggestion( code = "align(...)" , applicability = "has-placeholders" ) ]
239
- pub span : Span ,
239
+ pub ( crate ) span : Span ,
240
240
}
241
241
242
242
#[ derive( Diagnostic ) ]
243
243
#[ diag( attr_invalid_repr_generic, code = E0589 ) ]
244
244
pub ( crate ) struct InvalidReprGeneric < ' a > {
245
245
#[ primary_span]
246
- pub span : Span ,
246
+ pub ( crate ) span : Span ,
247
247
248
- pub repr_arg : String ,
249
- pub error_part : & ' a str ,
248
+ pub ( crate ) repr_arg : String ,
249
+ pub ( crate ) error_part : & ' a str ,
250
250
}
251
251
252
252
#[ derive( Diagnostic ) ]
253
253
#[ diag( attr_incorrect_repr_format_align_one_arg, code = E0693 ) ]
254
254
pub ( crate ) struct IncorrectReprFormatAlignOneArg {
255
255
#[ primary_span]
256
- pub span : Span ,
256
+ pub ( crate ) span : Span ,
257
257
}
258
258
259
259
#[ derive( Diagnostic ) ]
260
260
#[ diag( attr_incorrect_repr_format_expect_literal_integer, code = E0693 ) ]
261
261
pub ( crate ) struct IncorrectReprFormatExpectInteger {
262
262
#[ primary_span]
263
- pub span : Span ,
263
+ pub ( crate ) span : Span ,
264
264
}
265
265
266
266
#[ derive( Diagnostic ) ]
267
267
#[ diag( attr_incorrect_repr_format_generic, code = E0693 ) ]
268
268
pub ( crate ) struct IncorrectReprFormatGeneric < ' a > {
269
269
#[ primary_span]
270
- pub span : Span ,
270
+ pub ( crate ) span : Span ,
271
271
272
- pub repr_arg : & ' a str ,
272
+ pub ( crate ) repr_arg : & ' a str ,
273
273
274
274
#[ subdiagnostic]
275
- pub cause : Option < IncorrectReprFormatGenericCause < ' a > > ,
275
+ pub ( crate ) cause : Option < IncorrectReprFormatGenericCause < ' a > > ,
276
276
}
277
277
278
278
#[ derive( Subdiagnostic ) ]
@@ -303,7 +303,7 @@ pub(crate) enum IncorrectReprFormatGenericCause<'a> {
303
303
}
304
304
305
305
impl < ' a > IncorrectReprFormatGenericCause < ' a > {
306
- pub fn from_lit_kind ( span : Span , kind : & ast:: LitKind , name : & ' a str ) -> Option < Self > {
306
+ pub ( crate ) fn from_lit_kind ( span : Span , kind : & ast:: LitKind , name : & ' a str ) -> Option < Self > {
307
307
match kind {
308
308
ast:: LitKind :: Int ( int, ast:: LitIntType :: Unsuffixed ) => {
309
309
Some ( Self :: Int { span, name, int : int. get ( ) } )
@@ -318,85 +318,85 @@ impl<'a> IncorrectReprFormatGenericCause<'a> {
318
318
#[ diag( attr_rustc_promotable_pairing, code = E0717 ) ]
319
319
pub ( crate ) struct RustcPromotablePairing {
320
320
#[ primary_span]
321
- pub span : Span ,
321
+ pub ( crate ) span : Span ,
322
322
}
323
323
324
324
#[ derive( Diagnostic ) ]
325
325
#[ diag( attr_rustc_allowed_unstable_pairing, code = E0789 ) ]
326
326
pub ( crate ) struct RustcAllowedUnstablePairing {
327
327
#[ primary_span]
328
- pub span : Span ,
328
+ pub ( crate ) span : Span ,
329
329
}
330
330
331
331
#[ derive( Diagnostic ) ]
332
332
#[ diag( attr_cfg_predicate_identifier) ]
333
333
pub ( crate ) struct CfgPredicateIdentifier {
334
334
#[ primary_span]
335
- pub span : Span ,
335
+ pub ( crate ) span : Span ,
336
336
}
337
337
338
338
#[ derive( Diagnostic ) ]
339
339
#[ diag( attr_deprecated_item_suggestion) ]
340
340
pub ( crate ) struct DeprecatedItemSuggestion {
341
341
#[ primary_span]
342
- pub span : Span ,
342
+ pub ( crate ) span : Span ,
343
343
344
344
#[ help]
345
- pub is_nightly : Option < ( ) > ,
345
+ pub ( crate ) is_nightly : Option < ( ) > ,
346
346
347
347
#[ note]
348
- pub details : ( ) ,
348
+ pub ( crate ) details : ( ) ,
349
349
}
350
350
351
351
#[ derive( Diagnostic ) ]
352
352
#[ diag( attr_expected_single_version_literal) ]
353
353
pub ( crate ) struct ExpectedSingleVersionLiteral {
354
354
#[ primary_span]
355
- pub span : Span ,
355
+ pub ( crate ) span : Span ,
356
356
}
357
357
358
358
#[ derive( Diagnostic ) ]
359
359
#[ diag( attr_expected_version_literal) ]
360
360
pub ( crate ) struct ExpectedVersionLiteral {
361
361
#[ primary_span]
362
- pub span : Span ,
362
+ pub ( crate ) span : Span ,
363
363
}
364
364
365
365
#[ derive( Diagnostic ) ]
366
366
#[ diag( attr_expects_feature_list) ]
367
367
pub ( crate ) struct ExpectsFeatureList {
368
368
#[ primary_span]
369
- pub span : Span ,
369
+ pub ( crate ) span : Span ,
370
370
371
- pub name : String ,
371
+ pub ( crate ) name : String ,
372
372
}
373
373
374
374
#[ derive( Diagnostic ) ]
375
375
#[ diag( attr_expects_features) ]
376
376
pub ( crate ) struct ExpectsFeatures {
377
377
#[ primary_span]
378
- pub span : Span ,
378
+ pub ( crate ) span : Span ,
379
379
380
- pub name : String ,
380
+ pub ( crate ) name : String ,
381
381
}
382
382
383
383
#[ derive( Diagnostic ) ]
384
384
#[ diag( attr_invalid_since) ]
385
385
pub ( crate ) struct InvalidSince {
386
386
#[ primary_span]
387
- pub span : Span ,
387
+ pub ( crate ) span : Span ,
388
388
}
389
389
390
390
#[ derive( Diagnostic ) ]
391
391
#[ diag( attr_soft_no_args) ]
392
392
pub ( crate ) struct SoftNoArgs {
393
393
#[ primary_span]
394
- pub span : Span ,
394
+ pub ( crate ) span : Span ,
395
395
}
396
396
397
397
#[ derive( Diagnostic ) ]
398
398
#[ diag( attr_unknown_version_literal) ]
399
399
pub ( crate ) struct UnknownVersionLiteral {
400
400
#[ primary_span]
401
- pub span : Span ,
401
+ pub ( crate ) span : Span ,
402
402
}
0 commit comments