@@ -50,7 +50,7 @@ enum DiagnosticOnEnum {
50
50
#[ derive( Diagnostic ) ]
51
51
#[ diag( no_crate_example, code = "E0123" ) ]
52
52
#[ diag = "E0123" ]
53
- //~^ ERROR ` #[diag = ...]` is not a valid attribute
53
+ //~^ ERROR expected parentheses: #[diag( ...)]
54
54
struct WrongStructAttrStyle { }
55
55
56
56
#[ derive( Diagnostic ) ]
@@ -62,8 +62,7 @@ struct InvalidStructAttr {}
62
62
63
63
#[ derive( Diagnostic ) ]
64
64
#[ diag( "E0123" ) ]
65
- //~^ ERROR `#[diag("...")]` is not a valid attribute
66
- //~^^ ERROR diagnostic slug not specified
65
+ //~^ ERROR diagnostic slug not specified
67
66
struct InvalidLitNestedAttr { }
68
67
69
68
#[ derive( Diagnostic ) ]
@@ -73,27 +72,25 @@ struct InvalidNestedStructAttr {}
73
72
74
73
#[ derive( Diagnostic ) ]
75
74
#[ diag( nonsense( "foo" ) , code = "E0123" , slug = "foo" ) ]
76
- //~^ ERROR `#[diag(nonsense(...))]` is not a valid attribute
77
- //~^^ ERROR diagnostic slug not specified
75
+ //~^ ERROR diagnostic slug must be the first argument
76
+ //~| ERROR diagnostic slug not specified
78
77
struct InvalidNestedStructAttr1 { }
79
78
80
79
#[ derive( Diagnostic ) ]
81
80
#[ diag( nonsense = "..." , code = "E0123" , slug = "foo" ) ]
82
- //~^ ERROR `#[diag(nonsense = ...)]` is not a valid attribute
83
- //~| ERROR `#[diag(slug = ...)]` is not a valid attribute
81
+ //~^ ERROR unknown argument
84
82
//~| ERROR diagnostic slug not specified
85
83
struct InvalidNestedStructAttr2 { }
86
84
87
85
#[ derive( Diagnostic ) ]
88
86
#[ diag( nonsense = 4 , code = "E0123" , slug = "foo" ) ]
89
- //~^ ERROR `#[diag(nonsense = ...)]` is not a valid attribute
90
- //~| ERROR `#[diag(slug = ...)]` is not a valid attribute
87
+ //~^ ERROR unknown argument
91
88
//~| ERROR diagnostic slug not specified
92
89
struct InvalidNestedStructAttr3 { }
93
90
94
91
#[ derive( Diagnostic ) ]
95
92
#[ diag( no_crate_example, code = "E0123" , slug = "foo" ) ]
96
- //~^ ERROR `#[diag(slug = ...)]` is not a valid attribute
93
+ //~^ ERROR unknown argument
97
94
struct InvalidNestedStructAttr4 { }
98
95
99
96
#[ derive( Diagnostic ) ]
@@ -118,7 +115,7 @@ struct CodeSpecifiedTwice {}
118
115
119
116
#[ derive( Diagnostic ) ]
120
117
#[ diag( no_crate_example, no_crate:: example, code = "E0456" ) ]
121
- //~^ ERROR `#[diag(no_crate::example)]` is not a valid attribute
118
+ //~^ ERROR diagnostic slug must be the first argument
122
119
struct SlugSpecifiedTwice { }
123
120
124
121
#[ derive( Diagnostic ) ]
@@ -232,7 +229,7 @@ struct SuggestWithoutCode {
232
229
#[ diag( no_crate_example, code = "E0123" ) ]
233
230
struct SuggestWithBadKey {
234
231
#[ suggestion( nonsense = "bar" ) ]
235
- //~^ ERROR `#[suggestion(nonsense = ...)]` is not a valid attribute
232
+ //~^ ERROR invalid nested attribute
236
233
//~| ERROR suggestion without `code = "..."`
237
234
suggestion : ( Span , Applicability ) ,
238
235
}
@@ -241,7 +238,7 @@ struct SuggestWithBadKey {
241
238
#[ diag( no_crate_example, code = "E0123" ) ]
242
239
struct SuggestWithShorthandMsg {
243
240
#[ suggestion( msg = "bar" ) ]
244
- //~^ ERROR `#[suggestion(msg = ...)]` is not a valid attribute
241
+ //~^ ERROR invalid nested attribute
245
242
//~| ERROR suggestion without `code = "..."`
246
243
suggestion : ( Span , Applicability ) ,
247
244
}
@@ -530,23 +527,23 @@ struct BoolField {
530
527
#[ diag( no_crate_example, code = "E0123" ) ]
531
528
struct LabelWithTrailingPath {
532
529
#[ label( no_crate_label, foo) ]
533
- //~^ ERROR `#[label(foo)]` is not a valid attribute
530
+ //~^ ERROR a diagnostic slug must be the first argument to the attribute
534
531
span : Span ,
535
532
}
536
533
537
534
#[ derive( Diagnostic ) ]
538
535
#[ diag( no_crate_example, code = "E0123" ) ]
539
536
struct LabelWithTrailingNameValue {
540
537
#[ label( no_crate_label, foo = "..." ) ]
541
- //~^ ERROR `#[label(foo = ...)]` is not a valid attribute
538
+ //~^ ERROR invalid nested attribute
542
539
span : Span ,
543
540
}
544
541
545
542
#[ derive( Diagnostic ) ]
546
543
#[ diag( no_crate_example, code = "E0123" ) ]
547
544
struct LabelWithTrailingList {
548
545
#[ label( no_crate_label, foo( "..." ) ) ]
549
- //~^ ERROR `#[label(foo(...))]` is not a valid attribute
546
+ //~^ ERROR invalid nested attribute
550
547
span : Span ,
551
548
}
552
549
@@ -643,8 +640,8 @@ struct MissingCodeInSuggestion {
643
640
//~^ ERROR `#[multipart_suggestion(...)]` is not a valid attribute
644
641
//~| ERROR cannot find attribute `multipart_suggestion` in this scope
645
642
#[ multipart_suggestion( ) ]
646
- //~^ ERROR `#[ multipart_suggestion(...)]` is not a valid attribute
647
- //~| ERROR cannot find attribute `multipart_suggestion` in this scope
643
+ //~^ ERROR cannot find attribute ` multipart_suggestion` in this scope
644
+ //~| ERROR unexpected end of input, unexpected token in nested attribute, expected ident
648
645
struct MultipartSuggestion {
649
646
#[ multipart_suggestion( no_crate_suggestion) ]
650
647
//~^ ERROR `#[multipart_suggestion(...)]` is not a valid attribute
@@ -698,7 +695,7 @@ struct RawIdentDiagnosticArg {
698
695
#[ diag( no_crate_example) ]
699
696
struct SubdiagnosticBad {
700
697
#[ subdiagnostic( bad) ]
701
- //~^ ERROR `#[subdiagnostic(...)] ` is not a valid attribute
698
+ //~^ ERROR `eager ` is the only supported nested attribute for `subdiagnostic`
702
699
note : Note ,
703
700
}
704
701
@@ -714,15 +711,15 @@ struct SubdiagnosticBadStr {
714
711
#[ diag( no_crate_example) ]
715
712
struct SubdiagnosticBadTwice {
716
713
#[ subdiagnostic( bad, bad) ]
717
- //~^ ERROR `#[subdiagnostic(...)] ` is not a valid attribute
714
+ //~^ ERROR `eager ` is the only supported nested attribute for `subdiagnostic`
718
715
note : Note ,
719
716
}
720
717
721
718
#[ derive( Diagnostic ) ]
722
719
#[ diag( no_crate_example) ]
723
720
struct SubdiagnosticBadLitStr {
724
721
#[ subdiagnostic( "bad" ) ]
725
- //~^ ERROR `#[subdiagnostic(...)] ` is not a valid attribute
722
+ //~^ ERROR `eager ` is the only supported nested attribute for `subdiagnostic`
726
723
note : Note ,
727
724
}
728
725
@@ -797,14 +794,15 @@ struct SuggestionsNoItem {
797
794
struct SuggestionsInvalidItem {
798
795
#[ suggestion( code( foo) ) ]
799
796
//~^ ERROR `code(...)` must contain only string literals
797
+ //~| ERROR unexpected token
800
798
sub : Span ,
801
799
}
802
800
803
- #[ derive( Diagnostic ) ]
801
+ #[ derive( Diagnostic ) ] //~ ERROR cannot find value `__code_34` in this scope
804
802
#[ diag( no_crate_example) ]
805
803
struct SuggestionsInvalidLiteral {
806
804
#[ suggestion( code = 3 ) ]
807
- //~^ ERROR `code = "..."`/`code(...)` must contain only string literals
805
+ //~^ ERROR expected string literal
808
806
sub : Span ,
809
807
}
810
808
0 commit comments