@@ -82,7 +82,7 @@ struct F {
82
82
83
83
#[ derive( Subdiagnostic ) ]
84
84
#[ label( bug = "..." ) ]
85
- //~^ ERROR `#[label(bug = ...)]` is not a valid attribute
85
+ //~^ ERROR invalid nested attribute
86
86
//~| ERROR diagnostic slug must be first argument
87
87
struct G {
88
88
#[ primary_span]
@@ -92,8 +92,7 @@ struct G {
92
92
93
93
#[ derive( Subdiagnostic ) ]
94
94
#[ label( "..." ) ]
95
- //~^ ERROR `#[label("...")]` is not a valid attribute
96
- //~| ERROR diagnostic slug must be first argument
95
+ //~^ ERROR unexpected literal in nested attribute, expected ident
97
96
struct H {
98
97
#[ primary_span]
99
98
span : Span ,
@@ -102,7 +101,7 @@ struct H {
102
101
103
102
#[ derive( Subdiagnostic ) ]
104
103
#[ label( slug = 4 ) ]
105
- //~^ ERROR `#[label(slug = ...)]` is not a valid attribute
104
+ //~^ ERROR invalid nested attribute
106
105
//~| ERROR diagnostic slug must be first argument
107
106
struct J {
108
107
#[ primary_span]
@@ -112,7 +111,7 @@ struct J {
112
111
113
112
#[ derive( Subdiagnostic ) ]
114
113
#[ label( slug( "..." ) ) ]
115
- //~^ ERROR `#[label(slug(...))]` is not a valid attribute
114
+ //~^ ERROR invalid nested attribute
116
115
//~| ERROR diagnostic slug must be first argument
117
116
struct K {
118
117
#[ primary_span]
@@ -132,7 +131,7 @@ struct L {
132
131
133
132
#[ derive( Subdiagnostic ) ]
134
133
#[ label( ) ]
135
- //~^ ERROR diagnostic slug must be first argument of a `#[label(...)]` attribute
134
+ //~^ ERROR unexpected end of input, unexpected token in nested attribute, expected ident
136
135
struct M {
137
136
#[ primary_span]
138
137
span : Span ,
@@ -141,7 +140,7 @@ struct M {
141
140
142
141
#[ derive( Subdiagnostic ) ]
143
142
#[ label( no_crate_example, code = "..." ) ]
144
- //~^ ERROR `#[label(code = ...)]` is not a valid attribute
143
+ //~^ ERROR invalid nested attribute
145
144
struct N {
146
145
#[ primary_span]
147
146
span : Span ,
@@ -150,7 +149,7 @@ struct N {
150
149
151
150
#[ derive( Subdiagnostic ) ]
152
151
#[ label( no_crate_example, applicability = "machine-applicable" ) ]
153
- //~^ ERROR `#[label(applicability = ...)]` is not a valid attribute
152
+ //~^ ERROR invalid nested attribute
154
153
struct O {
155
154
#[ primary_span]
156
155
span : Span ,
@@ -222,7 +221,7 @@ enum T {
222
221
enum U {
223
222
#[ label( code = "..." ) ]
224
223
//~^ ERROR diagnostic slug must be first argument of a `#[label(...)]` attribute
225
- //~| ERROR `#[label(code = ...)]` is not a valid attribute
224
+ //~| ERROR invalid nested attribute
226
225
A {
227
226
#[ primary_span]
228
227
span : Span ,
@@ -323,7 +322,7 @@ struct AD {
323
322
324
323
#[ derive( Subdiagnostic ) ]
325
324
#[ label( no_crate_example, no_crate:: example) ]
326
- //~^ ERROR `#[label(no_crate::example)]` is not a valid attribute
325
+ //~^ ERROR a diagnostic slug must be the first argument to the attribute
327
326
struct AE {
328
327
#[ primary_span]
329
328
span : Span ,
@@ -537,7 +536,7 @@ struct BA {
537
536
#[ derive( Subdiagnostic ) ]
538
537
#[ multipart_suggestion( no_crate_example, code = "..." , applicability = "machine-applicable" ) ]
539
538
//~^ ERROR multipart suggestion without any `#[suggestion_part(...)]` fields
540
- //~| ERROR `#[multipart_suggestion(code = ...)]` is not a valid attribute
539
+ //~| ERROR invalid nested attribute
541
540
struct BBa {
542
541
var : String ,
543
542
}
@@ -554,7 +553,7 @@ struct BBb {
554
553
#[ multipart_suggestion( no_crate_example, applicability = "machine-applicable" ) ]
555
554
struct BBc {
556
555
#[ suggestion_part( ) ]
557
- //~^ ERROR `#[suggestion_part(...)]` attribute without `code = "..."`
556
+ //~^ ERROR unexpected end of input, unexpected token in nested attribute, expected ident
558
557
span1 : Span ,
559
558
}
560
559
@@ -574,10 +573,11 @@ struct BD {
574
573
//~^ ERROR `#[suggestion_part(...)]` attribute without `code = "..."`
575
574
span1 : Span ,
576
575
#[ suggestion_part( ) ]
577
- //~^ ERROR `#[suggestion_part(...)]` attribute without `code = "..."`
576
+ //~^ ERROR unexpected end of input, unexpected token in nested attribute, expected ident
578
577
span2 : Span ,
579
578
#[ suggestion_part( foo = "bar" ) ]
580
- //~^ ERROR `#[suggestion_part(foo = ...)]` is not a valid attribute
579
+ //~^ ERROR `code` is the only valid nested attribute
580
+ //~| ERROR expected `,`
581
581
span4 : Span ,
582
582
#[ suggestion_part( code = "..." ) ]
583
583
//~^ ERROR the `#[suggestion_part(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
@@ -669,6 +669,7 @@ enum BL {
669
669
struct BM {
670
670
#[ suggestion_part( code( "foo" ) ) ]
671
671
//~^ ERROR expected exactly one string literal for `code = ...`
672
+ //~| ERROR unexpected token
672
673
span : Span ,
673
674
r#type : String ,
674
675
}
@@ -678,6 +679,7 @@ struct BM {
678
679
struct BN {
679
680
#[ suggestion_part( code( "foo" , "bar" ) ) ]
680
681
//~^ ERROR expected exactly one string literal for `code = ...`
682
+ //~| ERROR unexpected token
681
683
span : Span ,
682
684
r#type : String ,
683
685
}
@@ -687,6 +689,7 @@ struct BN {
687
689
struct BO {
688
690
#[ suggestion_part( code( 3 ) ) ]
689
691
//~^ ERROR expected exactly one string literal for `code = ...`
692
+ //~| ERROR unexpected token
690
693
span : Span ,
691
694
r#type : String ,
692
695
}
@@ -701,10 +704,13 @@ struct BP {
701
704
}
702
705
703
706
#[ derive( Subdiagnostic ) ]
707
+ //~^ ERROR cannot find value `__code_29` in this scope
708
+ //~| NOTE in this expansion
709
+ //~| NOTE not found in this scope
704
710
#[ multipart_suggestion( no_crate_example) ]
705
711
struct BQ {
706
712
#[ suggestion_part( code = 3 ) ]
707
- //~^ ERROR `code = "..."`/`code(...)` must contain only string literals
713
+ //~^ ERROR expected string literal
708
714
span : Span ,
709
715
r#type : String ,
710
716
}
@@ -779,23 +785,24 @@ struct SuggestionStyleInvalid1 {
779
785
780
786
#[ derive( Subdiagnostic ) ]
781
787
#[ suggestion( no_crate_example, code = "" , style = 42 ) ]
782
- //~^ ERROR `#[suggestion(style = ...)]` is not a valid attribute
788
+ //~^ ERROR expected `= "xxx"`
783
789
struct SuggestionStyleInvalid2 {
784
790
#[ primary_span]
785
791
sub : Span ,
786
792
}
787
793
788
794
#[ derive( Subdiagnostic ) ]
789
795
#[ suggestion( no_crate_example, code = "" , style) ]
790
- //~^ ERROR `#[suggestion(style)]` is not a valid attribute
796
+ //~^ ERROR a diagnostic slug must be the first argument to the attribute
791
797
struct SuggestionStyleInvalid3 {
792
798
#[ primary_span]
793
799
sub : Span ,
794
800
}
795
801
796
802
#[ derive( Subdiagnostic ) ]
797
803
#[ suggestion( no_crate_example, code = "" , style( "foo" ) ) ]
798
- //~^ ERROR `#[suggestion(style(...))]` is not a valid attribute
804
+ //~^ ERROR expected `= "xxx"`
805
+ //~| ERROr expected `,`
799
806
struct SuggestionStyleInvalid4 {
800
807
#[ primary_span]
801
808
sub : Span ,
0 commit comments