@@ -29,25 +29,25 @@ fn handle_errors(sess: &ParseSess, span: Span, error: AttrError) {
29
29
let diag = & sess. span_diagnostic ;
30
30
match error {
31
31
AttrError :: MultipleItem ( item) => {
32
- struct_span_err ! ( diag, span, E0538 , "multiple '{}' items" , item) . emit ( ) ;
32
+ struct_span_err ! ( diag, span, " E0538" , "multiple '{}' items" , item) . emit ( ) ;
33
33
}
34
34
AttrError :: UnknownMetaItem ( item, expected) => {
35
35
let expected = expected. iter ( ) . map ( |name| format ! ( "`{}`" , name) ) . collect :: < Vec < _ > > ( ) ;
36
- struct_span_err ! ( diag, span, E0541 , "unknown meta item '{}'" , item)
36
+ struct_span_err ! ( diag, span, " E0541" , "unknown meta item '{}'" , item)
37
37
. span_label ( span, format ! ( "expected one of {}" , expected. join( ", " ) ) )
38
38
. emit ( ) ;
39
39
}
40
40
AttrError :: MissingSince => {
41
- struct_span_err ! ( diag, span, E0542 , "missing 'since'" ) . emit ( ) ;
41
+ struct_span_err ! ( diag, span, " E0542" , "missing 'since'" ) . emit ( ) ;
42
42
}
43
43
AttrError :: MissingFeature => {
44
- struct_span_err ! ( diag, span, E0546 , "missing 'feature'" ) . emit ( ) ;
44
+ struct_span_err ! ( diag, span, " E0546" , "missing 'feature'" ) . emit ( ) ;
45
45
}
46
46
AttrError :: MultipleStabilityLevels => {
47
- struct_span_err ! ( diag, span, E0544 , "multiple stability levels" ) . emit ( ) ;
47
+ struct_span_err ! ( diag, span, " E0544" , "multiple stability levels" ) . emit ( ) ;
48
48
}
49
49
AttrError :: UnsupportedLiteral ( msg, is_bytestr) => {
50
- let mut err = struct_span_err ! ( diag, span, E0565 , "{}" , msg) ;
50
+ let mut err = struct_span_err ! ( diag, span, " E0565" , "{}" , msg) ;
51
51
if is_bytestr {
52
52
if let Ok ( lint_str) = sess. source_map ( ) . span_to_snippet ( span) {
53
53
err. span_suggestion (
@@ -99,7 +99,8 @@ pub fn find_unwind_attr(diagnostic: Option<&Handler>, attrs: &[Attribute]) -> Op
99
99
}
100
100
101
101
diagnostic. map ( |d| {
102
- struct_span_err ! ( d, attr. span, E0633 , "malformed `unwind` attribute input" )
102
+ struct_span_err ! ( d, attr. span, "E0633" ,
103
+ "malformed `unwind` attribute input" )
103
104
. span_label ( attr. span , "invalid argument" )
104
105
. span_suggestions (
105
106
attr. span ,
@@ -286,7 +287,7 @@ where
286
287
* item = Some ( v) ;
287
288
true
288
289
} else {
289
- struct_span_err ! ( diagnostic, meta. span, E0539 , "incorrect meta item" ) . emit ( ) ;
290
+ struct_span_err ! ( diagnostic, meta. span, " E0539" , "incorrect meta item" ) . emit ( ) ;
290
291
false
291
292
}
292
293
} ;
@@ -337,7 +338,7 @@ where
337
338
struct_span_err ! (
338
339
diagnostic,
339
340
item_sp,
340
- E0540 ,
341
+ " E0540" ,
341
342
"multiple rustc_deprecated attributes"
342
343
)
343
344
. emit ( ) ;
@@ -355,7 +356,7 @@ where
355
356
continue ;
356
357
}
357
358
_ => {
358
- struct_span_err ! ( diagnostic, attr. span, E0543 , "missing 'reason'" )
359
+ struct_span_err ! ( diagnostic, attr. span, " E0543" , "missing 'reason'" )
359
360
. emit ( ) ;
360
361
continue ;
361
362
}
@@ -477,7 +478,7 @@ where
477
478
continue ;
478
479
}
479
480
_ => {
480
- struct_span_err ! ( diagnostic, attr. span, E0547 , "missing 'issue'" )
481
+ struct_span_err ! ( diagnostic, attr. span, " E0547" , "missing 'issue'" )
481
482
. emit ( ) ;
482
483
continue ;
483
484
}
@@ -567,7 +568,7 @@ where
567
568
struct_span_err ! (
568
569
diagnostic,
569
570
item_sp,
570
- E0549 ,
571
+ " E0549" ,
571
572
"rustc_deprecated attribute must be paired with \
572
573
either stable or unstable attribute"
573
574
)
@@ -584,7 +585,7 @@ where
584
585
struct_span_err ! (
585
586
diagnostic,
586
587
item_sp,
587
- E0717 ,
588
+ " E0717" ,
588
589
"rustc_promotable and rustc_allow_const_fn_ptr attributes \
589
590
must be paired with either a rustc_const_unstable or a rustc_const_stable \
590
591
attribute"
@@ -679,7 +680,7 @@ pub fn eval_condition(
679
680
struct_span_err ! (
680
681
sess. span_diagnostic,
681
682
cfg. span,
682
- E0536 ,
683
+ " E0536" ,
683
684
"expected 1 cfg-pattern"
684
685
)
685
686
. emit ( ) ;
@@ -692,7 +693,7 @@ pub fn eval_condition(
692
693
struct_span_err ! (
693
694
sess. span_diagnostic,
694
695
cfg. span,
695
- E0537 ,
696
+ " E0537" ,
696
697
"invalid predicate `{}`" ,
697
698
pprust:: path_to_string( & cfg. path)
698
699
)
@@ -737,7 +738,7 @@ where
737
738
}
738
739
739
740
if depr. is_some ( ) {
740
- struct_span_err ! ( diagnostic, item_sp, E0550 , "multiple deprecated attributes" ) . emit ( ) ;
741
+ struct_span_err ! ( diagnostic, item_sp, " E0550" , "multiple deprecated attributes" ) . emit ( ) ;
741
742
break ;
742
743
}
743
744
@@ -775,7 +776,7 @@ where
775
776
) ,
776
777
) ;
777
778
} else {
778
- struct_span_err ! ( diagnostic, meta. span, E0551 , "incorrect meta item" )
779
+ struct_span_err ! ( diagnostic, meta. span, " E0551" , "incorrect meta item" )
779
780
. emit ( ) ;
780
781
}
781
782
@@ -940,7 +941,7 @@ pub fn find_repr_attrs(sess: &ParseSess, attr: &Attribute) -> Vec<ReprAttr> {
940
941
struct_span_err ! (
941
942
diagnostic,
942
943
item. span( ) ,
943
- E0589 ,
944
+ " E0589" ,
944
945
"invalid `repr(align)` attribute: {}" ,
945
946
literal_error
946
947
)
@@ -954,7 +955,7 @@ pub fn find_repr_attrs(sess: &ParseSess, attr: &Attribute) -> Vec<ReprAttr> {
954
955
let mut err = struct_span_err ! (
955
956
diagnostic,
956
957
item. span( ) ,
957
- E0693 ,
958
+ " E0693" ,
958
959
"incorrect `repr(align)` attribute format"
959
960
) ;
960
961
match value. kind {
@@ -986,7 +987,7 @@ pub fn find_repr_attrs(sess: &ParseSess, attr: &Attribute) -> Vec<ReprAttr> {
986
987
struct_span_err ! (
987
988
diagnostic,
988
989
item. span( ) ,
989
- E0552 ,
990
+ " E0552" ,
990
991
"unrecognized representation hint"
991
992
)
992
993
. emit ( ) ;
0 commit comments