@@ -8,14 +8,14 @@ use rustc_span::{Span, Symbol};
8
8
use crate::UnsupportedLiteralReason;
9
9
10
10
#[derive(SessionDiagnostic)]
11
- #[ error ( attr:: expected_one_cfg_pattern, code = "E0536" ) ]
11
+ #[diag (attr::expected_one_cfg_pattern, code = "E0536")]
12
12
pub(crate) struct ExpectedOneCfgPattern {
13
13
#[primary_span]
14
14
pub span: Span,
15
15
}
16
16
17
17
#[derive(SessionDiagnostic)]
18
- #[ error ( attr:: invalid_predicate, code = "E0537" ) ]
18
+ #[diag (attr::invalid_predicate, code = "E0537")]
19
19
pub(crate) struct InvalidPredicate {
20
20
#[primary_span]
21
21
pub span: Span,
@@ -24,7 +24,7 @@ pub(crate) struct InvalidPredicate {
24
24
}
25
25
26
26
#[derive(SessionDiagnostic)]
27
- #[ error ( attr:: multiple_item, code = "E0538" ) ]
27
+ #[diag (attr::multiple_item, code = "E0538")]
28
28
pub(crate) struct MultipleItem {
29
29
#[primary_span]
30
30
pub span: Span,
@@ -33,7 +33,7 @@ pub(crate) struct MultipleItem {
33
33
}
34
34
35
35
#[derive(SessionDiagnostic)]
36
- #[ error ( attr:: incorrect_meta_item, code = "E0539" ) ]
36
+ #[diag (attr::incorrect_meta_item, code = "E0539")]
37
37
pub(crate) struct IncorrectMetaItem {
38
38
#[primary_span]
39
39
pub span: Span,
@@ -63,28 +63,28 @@ impl<'a> SessionDiagnostic<'a> for UnknownMetaItem<'_> {
63
63
}
64
64
65
65
#[derive(SessionDiagnostic)]
66
- #[ error ( attr:: missing_since, code = "E0542" ) ]
66
+ #[diag (attr::missing_since, code = "E0542")]
67
67
pub(crate) struct MissingSince {
68
68
#[primary_span]
69
69
pub span: Span,
70
70
}
71
71
72
72
#[derive(SessionDiagnostic)]
73
- #[ error ( attr:: missing_note, code = "E0543" ) ]
73
+ #[diag (attr::missing_note, code = "E0543")]
74
74
pub(crate) struct MissingNote {
75
75
#[primary_span]
76
76
pub span: Span,
77
77
}
78
78
79
79
#[derive(SessionDiagnostic)]
80
- #[ error ( attr:: multiple_stability_levels, code = "E0544" ) ]
80
+ #[diag (attr::multiple_stability_levels, code = "E0544")]
81
81
pub(crate) struct MultipleStabilityLevels {
82
82
#[primary_span]
83
83
pub span: Span,
84
84
}
85
85
86
86
#[derive(SessionDiagnostic)]
87
- #[ error ( attr:: invalid_issue_string, code = "E0545" ) ]
87
+ #[diag (attr::invalid_issue_string, code = "E0545")]
88
88
pub(crate) struct InvalidIssueString {
89
89
#[primary_span]
90
90
pub span: Span,
@@ -142,21 +142,21 @@ impl InvalidIssueStringCause {
142
142
}
143
143
144
144
#[derive(SessionDiagnostic)]
145
- #[ error ( attr:: missing_feature, code = "E0546" ) ]
145
+ #[diag (attr::missing_feature, code = "E0546")]
146
146
pub(crate) struct MissingFeature {
147
147
#[primary_span]
148
148
pub span: Span,
149
149
}
150
150
151
151
#[derive(SessionDiagnostic)]
152
- #[ error ( attr:: non_ident_feature, code = "E0546" ) ]
152
+ #[diag (attr::non_ident_feature, code = "E0546")]
153
153
pub(crate) struct NonIdentFeature {
154
154
#[primary_span]
155
155
pub span: Span,
156
156
}
157
157
158
158
#[derive(SessionDiagnostic)]
159
- #[ error ( attr:: missing_issue, code = "E0547" ) ]
159
+ #[diag (attr::missing_issue, code = "E0547")]
160
160
pub(crate) struct MissingIssue {
161
161
#[primary_span]
162
162
pub span: Span,
@@ -165,7 +165,7 @@ pub(crate) struct MissingIssue {
165
165
// FIXME: This diagnostic is identical to `IncorrectMetaItem`, barring the error code. Consider
166
166
// changing this to `IncorrectMetaItem`. See #51489.
167
167
#[derive(SessionDiagnostic)]
168
- #[ error ( attr:: incorrect_meta_item, code = "E0551" ) ]
168
+ #[diag (attr::incorrect_meta_item, code = "E0551")]
169
169
pub(crate) struct IncorrectMetaItem2 {
170
170
#[primary_span]
171
171
pub span: Span,
@@ -174,14 +174,14 @@ pub(crate) struct IncorrectMetaItem2 {
174
174
// FIXME: Why is this the same error code as `InvalidReprHintNoParen` and `InvalidReprHintNoValue`?
175
175
// It is more similar to `IncorrectReprFormatGeneric`.
176
176
#[derive(SessionDiagnostic)]
177
- #[ error ( attr:: incorrect_repr_format_packed_one_or_zero_arg, code = "E0552" ) ]
177
+ #[diag (attr::incorrect_repr_format_packed_one_or_zero_arg, code = "E0552")]
178
178
pub(crate) struct IncorrectReprFormatPackedOneOrZeroArg {
179
179
#[primary_span]
180
180
pub span: Span,
181
181
}
182
182
183
183
#[derive(SessionDiagnostic)]
184
- #[ error ( attr:: invalid_repr_hint_no_paren, code = "E0552" ) ]
184
+ #[diag (attr::invalid_repr_hint_no_paren, code = "E0552")]
185
185
pub(crate) struct InvalidReprHintNoParen {
186
186
#[primary_span]
187
187
pub span: Span,
@@ -190,7 +190,7 @@ pub(crate) struct InvalidReprHintNoParen {
190
190
}
191
191
192
192
#[derive(SessionDiagnostic)]
193
- #[ error ( attr:: invalid_repr_hint_no_value, code = "E0552" ) ]
193
+ #[diag (attr::invalid_repr_hint_no_value, code = "E0552")]
194
194
pub(crate) struct InvalidReprHintNoValue {
195
195
#[primary_span]
196
196
pub span: Span,
@@ -234,16 +234,17 @@ impl<'a> SessionDiagnostic<'a> for UnsupportedLiteral {
234
234
diag
235
235
}
236
236
}
237
+
237
238
#[derive(SessionDiagnostic)]
238
- #[ error ( attr:: invalid_repr_align_need_arg, code = "E0589" ) ]
239
+ #[diag (attr::invalid_repr_align_need_arg, code = "E0589")]
239
240
pub(crate) struct InvalidReprAlignNeedArg {
240
241
#[primary_span]
241
242
#[suggestion(code = "align(...)", applicability = "has-placeholders")]
242
243
pub span: Span,
243
244
}
244
245
245
246
#[derive(SessionDiagnostic)]
246
- #[ error ( attr:: invalid_repr_generic, code = "E0589" ) ]
247
+ #[diag (attr::invalid_repr_generic, code = "E0589")]
247
248
pub(crate) struct InvalidReprGeneric<'a> {
248
249
#[primary_span]
249
250
pub span: Span,
@@ -253,14 +254,14 @@ pub(crate) struct InvalidReprGeneric<'a> {
253
254
}
254
255
255
256
#[derive(SessionDiagnostic)]
256
- #[ error ( attr:: incorrect_repr_format_align_one_arg, code = "E0693" ) ]
257
+ #[diag (attr::incorrect_repr_format_align_one_arg, code = "E0693")]
257
258
pub(crate) struct IncorrectReprFormatAlignOneArg {
258
259
#[primary_span]
259
260
pub span: Span,
260
261
}
261
262
262
263
#[derive(SessionDiagnostic)]
263
- #[ error ( attr:: incorrect_repr_format_generic, code = "E0693" ) ]
264
+ #[diag (attr::incorrect_repr_format_generic, code = "E0693")]
264
265
pub(crate) struct IncorrectReprFormatGeneric<'a> {
265
266
#[primary_span]
266
267
pub span: Span,
@@ -303,28 +304,28 @@ pub(crate) enum IncorrectReprFormatGenericCause<'a> {
303
304
}
304
305
305
306
#[derive(SessionDiagnostic)]
306
- #[ error ( attr:: rustc_promotable_pairing, code = "E0717" ) ]
307
+ #[diag (attr::rustc_promotable_pairing, code = "E0717")]
307
308
pub(crate) struct RustcPromotablePairing {
308
309
#[primary_span]
309
310
pub span: Span,
310
311
}
311
312
312
313
#[derive(SessionDiagnostic)]
313
- #[ error ( attr:: rustc_allowed_unstable_pairing, code = "E0789" ) ]
314
+ #[diag (attr::rustc_allowed_unstable_pairing, code = "E0789")]
314
315
pub(crate) struct RustcAllowedUnstablePairing {
315
316
#[primary_span]
316
317
pub span: Span,
317
318
}
318
319
319
320
#[derive(SessionDiagnostic)]
320
- #[ error ( attr:: cfg_predicate_identifier) ]
321
+ #[diag (attr::cfg_predicate_identifier)]
321
322
pub(crate) struct CfgPredicateIdentifier {
322
323
#[primary_span]
323
324
pub span: Span,
324
325
}
325
326
326
327
#[derive(SessionDiagnostic)]
327
- #[ error ( attr:: deprecated_item_suggestion) ]
328
+ #[diag (attr::deprecated_item_suggestion)]
328
329
#[note]
329
330
pub(crate) struct DeprecatedItemSuggestion {
330
331
#[primary_span]
@@ -335,21 +336,21 @@ pub(crate) struct DeprecatedItemSuggestion {
335
336
}
336
337
337
338
#[derive(SessionDiagnostic)]
338
- #[ error ( attr:: expected_single_version_literal) ]
339
+ #[diag (attr::expected_single_version_literal)]
339
340
pub(crate) struct ExpectedSingleVersionLiteral {
340
341
#[primary_span]
341
342
pub span: Span,
342
343
}
343
344
344
345
#[derive(SessionDiagnostic)]
345
- #[ error ( attr:: expected_version_literal) ]
346
+ #[diag (attr::expected_version_literal)]
346
347
pub(crate) struct ExpectedVersionLiteral {
347
348
#[primary_span]
348
349
pub span: Span,
349
350
}
350
351
351
352
#[derive(SessionDiagnostic)]
352
- #[ error ( attr:: expects_feature_list) ]
353
+ #[diag (attr::expects_feature_list)]
353
354
pub(crate) struct ExpectsFeatureList {
354
355
#[primary_span]
355
356
pub span: Span,
@@ -358,7 +359,7 @@ pub(crate) struct ExpectsFeatureList {
358
359
}
359
360
360
361
#[derive(SessionDiagnostic)]
361
- #[ error ( attr:: expects_features) ]
362
+ #[diag (attr::expects_features)]
362
363
pub(crate) struct ExpectsFeatures {
363
364
#[primary_span]
364
365
pub span: Span,
@@ -367,14 +368,14 @@ pub(crate) struct ExpectsFeatures {
367
368
}
368
369
369
370
#[derive(SessionDiagnostic)]
370
- #[ error ( attr:: soft_no_args) ]
371
+ #[diag (attr::soft_no_args)]
371
372
pub(crate) struct SoftNoArgs {
372
373
#[primary_span]
373
374
pub span: Span,
374
375
}
375
376
376
377
#[derive(SessionDiagnostic)]
377
- #[ warning ( attr:: unknown_version_literal) ]
378
+ #[diag (attr::unknown_version_literal)]
378
379
pub(crate) struct UnknownVersionLiteral {
379
380
#[primary_span]
380
381
pub span: Span,
0 commit comments