@@ -82,7 +82,7 @@ struct F {
8282
8383#[ derive( Subdiagnostic ) ]
8484#[ label( bug = "..." ) ]
85- //~^ ERROR `#[label(bug = ...)]` is not a valid attribute
85+ //~^ ERROR invalid nested attribute
8686//~| ERROR diagnostic slug must be first argument
8787struct G {
8888 #[ primary_span]
@@ -92,8 +92,7 @@ struct G {
9292
9393#[ derive( Subdiagnostic ) ]
9494#[ 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
9796struct H {
9897 #[ primary_span]
9998 span : Span ,
@@ -102,7 +101,7 @@ struct H {
102101
103102#[ derive( Subdiagnostic ) ]
104103#[ label( slug = 4 ) ]
105- //~^ ERROR `#[label(slug = ...)]` is not a valid attribute
104+ //~^ ERROR invalid nested attribute
106105//~| ERROR diagnostic slug must be first argument
107106struct J {
108107 #[ primary_span]
@@ -112,7 +111,7 @@ struct J {
112111
113112#[ derive( Subdiagnostic ) ]
114113#[ label( slug( "..." ) ) ]
115- //~^ ERROR `#[label(slug(...))]` is not a valid attribute
114+ //~^ ERROR invalid nested attribute
116115//~| ERROR diagnostic slug must be first argument
117116struct K {
118117 #[ primary_span]
@@ -132,7 +131,7 @@ struct L {
132131
133132#[ derive( Subdiagnostic ) ]
134133#[ 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
136135struct M {
137136 #[ primary_span]
138137 span : Span ,
@@ -141,7 +140,7 @@ struct M {
141140
142141#[ derive( Subdiagnostic ) ]
143142#[ label( no_crate_example, code = "..." ) ]
144- //~^ ERROR `#[label(code = ...)]` is not a valid attribute
143+ //~^ ERROR invalid nested attribute
145144struct N {
146145 #[ primary_span]
147146 span : Span ,
@@ -150,7 +149,7 @@ struct N {
150149
151150#[ derive( Subdiagnostic ) ]
152151#[ label( no_crate_example, applicability = "machine-applicable" ) ]
153- //~^ ERROR `#[label(applicability = ...)]` is not a valid attribute
152+ //~^ ERROR invalid nested attribute
154153struct O {
155154 #[ primary_span]
156155 span : Span ,
@@ -222,7 +221,7 @@ enum T {
222221enum U {
223222 #[ label( code = "..." ) ]
224223 //~^ 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
226225 A {
227226 #[ primary_span]
228227 span : Span ,
@@ -323,7 +322,7 @@ struct AD {
323322
324323#[ derive( Subdiagnostic ) ]
325324#[ 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
327326struct AE {
328327 #[ primary_span]
329328 span : Span ,
@@ -537,7 +536,7 @@ struct BA {
537536#[ derive( Subdiagnostic ) ]
538537#[ multipart_suggestion( no_crate_example, code = "..." , applicability = "machine-applicable" ) ]
539538//~^ ERROR multipart suggestion without any `#[suggestion_part(...)]` fields
540- //~| ERROR `#[multipart_suggestion(code = ...)]` is not a valid attribute
539+ //~| ERROR invalid nested attribute
541540struct BBa {
542541 var : String ,
543542}
@@ -554,7 +553,7 @@ struct BBb {
554553#[ multipart_suggestion( no_crate_example, applicability = "machine-applicable" ) ]
555554struct BBc {
556555 #[ suggestion_part( ) ]
557- //~^ ERROR `#[suggestion_part(...)]` attribute without `code = "..."`
556+ //~^ ERROR unexpected end of input, unexpected token in nested attribute, expected ident
558557 span1 : Span ,
559558}
560559
@@ -574,10 +573,11 @@ struct BD {
574573 //~^ ERROR `#[suggestion_part(...)]` attribute without `code = "..."`
575574 span1 : Span ,
576575 #[ suggestion_part( ) ]
577- //~^ ERROR `#[suggestion_part(...)]` attribute without `code = "..."`
576+ //~^ ERROR unexpected end of input, unexpected token in nested attribute, expected ident
578577 span2 : Span ,
579578 #[ 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 `,`
581581 span4 : Span ,
582582 #[ suggestion_part( code = "..." ) ]
583583 //~^ ERROR the `#[suggestion_part(...)]` attribute can only be applied to fields of type `Span` or `MultiSpan`
@@ -669,6 +669,7 @@ enum BL {
669669struct BM {
670670 #[ suggestion_part( code( "foo" ) ) ]
671671 //~^ ERROR expected exactly one string literal for `code = ...`
672+ //~| ERROR unexpected token
672673 span : Span ,
673674 r#type : String ,
674675}
@@ -678,6 +679,7 @@ struct BM {
678679struct BN {
679680 #[ suggestion_part( code( "foo" , "bar" ) ) ]
680681 //~^ ERROR expected exactly one string literal for `code = ...`
682+ //~| ERROR unexpected token
681683 span : Span ,
682684 r#type : String ,
683685}
@@ -687,6 +689,7 @@ struct BN {
687689struct BO {
688690 #[ suggestion_part( code( 3 ) ) ]
689691 //~^ ERROR expected exactly one string literal for `code = ...`
692+ //~| ERROR unexpected token
690693 span : Span ,
691694 r#type : String ,
692695}
@@ -701,10 +704,13 @@ struct BP {
701704}
702705
703706#[ derive( Subdiagnostic ) ]
707+ //~^ ERROR cannot find value `__code_29` in this scope
708+ //~| NOTE in this expansion
709+ //~| NOTE not found in this scope
704710#[ multipart_suggestion( no_crate_example) ]
705711struct BQ {
706712 #[ suggestion_part( code = 3 ) ]
707- //~^ ERROR `code = "..."`/`code(...)` must contain only string literals
713+ //~^ ERROR expected string literal
708714 span : Span ,
709715 r#type : String ,
710716}
@@ -779,23 +785,24 @@ struct SuggestionStyleInvalid1 {
779785
780786#[ derive( Subdiagnostic ) ]
781787#[ suggestion( no_crate_example, code = "" , style = 42 ) ]
782- //~^ ERROR `#[suggestion(style = ...)]` is not a valid attribute
788+ //~^ ERROR expected `= "xxx"`
783789struct SuggestionStyleInvalid2 {
784790 #[ primary_span]
785791 sub : Span ,
786792}
787793
788794#[ derive( Subdiagnostic ) ]
789795#[ 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
791797struct SuggestionStyleInvalid3 {
792798 #[ primary_span]
793799 sub : Span ,
794800}
795801
796802#[ derive( Subdiagnostic ) ]
797803#[ suggestion( no_crate_example, code = "" , style( "foo" ) ) ]
798- //~^ ERROR `#[suggestion(style(...))]` is not a valid attribute
804+ //~^ ERROR expected `= "xxx"`
805+ //~| ERROr expected `,`
799806struct SuggestionStyleInvalid4 {
800807 #[ primary_span]
801808 sub : Span ,
0 commit comments