@@ -50,7 +50,7 @@ enum DiagnosticOnEnum {
5050#[ derive( Diagnostic ) ]
5151#[ diag( no_crate_example, code = "E0123" ) ]
5252#[ diag = "E0123" ]
53- //~^ ERROR ` #[diag = ...]` is not a valid attribute
53+ //~^ ERROR expected parentheses: #[diag( ...)]
5454struct WrongStructAttrStyle { }
5555
5656#[ derive( Diagnostic ) ]
@@ -62,8 +62,7 @@ struct InvalidStructAttr {}
6262
6363#[ derive( Diagnostic ) ]
6464#[ diag( "E0123" ) ]
65- //~^ ERROR `#[diag("...")]` is not a valid attribute
66- //~^^ ERROR diagnostic slug not specified
65+ //~^ ERROR diagnostic slug not specified
6766struct InvalidLitNestedAttr { }
6867
6968#[ derive( Diagnostic ) ]
@@ -73,27 +72,25 @@ struct InvalidNestedStructAttr {}
7372
7473#[ derive( Diagnostic ) ]
7574#[ 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
7877struct InvalidNestedStructAttr1 { }
7978
8079#[ derive( Diagnostic ) ]
8180#[ 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
8482//~| ERROR diagnostic slug not specified
8583struct InvalidNestedStructAttr2 { }
8684
8785#[ derive( Diagnostic ) ]
8886#[ 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
9188//~| ERROR diagnostic slug not specified
9289struct InvalidNestedStructAttr3 { }
9390
9491#[ derive( Diagnostic ) ]
9592#[ diag( no_crate_example, code = "E0123" , slug = "foo" ) ]
96- //~^ ERROR `#[diag(slug = ...)]` is not a valid attribute
93+ //~^ ERROR unknown argument
9794struct InvalidNestedStructAttr4 { }
9895
9996#[ derive( Diagnostic ) ]
@@ -118,7 +115,7 @@ struct CodeSpecifiedTwice {}
118115
119116#[ derive( Diagnostic ) ]
120117#[ 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
122119struct SlugSpecifiedTwice { }
123120
124121#[ derive( Diagnostic ) ]
@@ -232,7 +229,7 @@ struct SuggestWithoutCode {
232229#[ diag( no_crate_example, code = "E0123" ) ]
233230struct SuggestWithBadKey {
234231 #[ suggestion( nonsense = "bar" ) ]
235- //~^ ERROR `#[suggestion(nonsense = ...)]` is not a valid attribute
232+ //~^ ERROR invalid nested attribute
236233 //~| ERROR suggestion without `code = "..."`
237234 suggestion : ( Span , Applicability ) ,
238235}
@@ -241,7 +238,7 @@ struct SuggestWithBadKey {
241238#[ diag( no_crate_example, code = "E0123" ) ]
242239struct SuggestWithShorthandMsg {
243240 #[ suggestion( msg = "bar" ) ]
244- //~^ ERROR `#[suggestion(msg = ...)]` is not a valid attribute
241+ //~^ ERROR invalid nested attribute
245242 //~| ERROR suggestion without `code = "..."`
246243 suggestion : ( Span , Applicability ) ,
247244}
@@ -530,23 +527,23 @@ struct BoolField {
530527#[ diag( no_crate_example, code = "E0123" ) ]
531528struct LabelWithTrailingPath {
532529 #[ 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
534531 span : Span ,
535532}
536533
537534#[ derive( Diagnostic ) ]
538535#[ diag( no_crate_example, code = "E0123" ) ]
539536struct LabelWithTrailingNameValue {
540537 #[ label( no_crate_label, foo = "..." ) ]
541- //~^ ERROR `#[label(foo = ...)]` is not a valid attribute
538+ //~^ ERROR invalid nested attribute
542539 span : Span ,
543540}
544541
545542#[ derive( Diagnostic ) ]
546543#[ diag( no_crate_example, code = "E0123" ) ]
547544struct LabelWithTrailingList {
548545 #[ label( no_crate_label, foo( "..." ) ) ]
549- //~^ ERROR `#[label(foo(...))]` is not a valid attribute
546+ //~^ ERROR invalid nested attribute
550547 span : Span ,
551548}
552549
@@ -643,8 +640,8 @@ struct MissingCodeInSuggestion {
643640//~^ ERROR `#[multipart_suggestion(...)]` is not a valid attribute
644641//~| ERROR cannot find attribute `multipart_suggestion` in this scope
645642#[ 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
648645struct MultipartSuggestion {
649646 #[ multipart_suggestion( no_crate_suggestion) ]
650647 //~^ ERROR `#[multipart_suggestion(...)]` is not a valid attribute
@@ -698,7 +695,7 @@ struct RawIdentDiagnosticArg {
698695#[ diag( no_crate_example) ]
699696struct SubdiagnosticBad {
700697 #[ subdiagnostic( bad) ]
701- //~^ ERROR `#[subdiagnostic(...)] ` is not a valid attribute
698+ //~^ ERROR `eager ` is the only supported nested attribute for `subdiagnostic`
702699 note : Note ,
703700}
704701
@@ -714,15 +711,15 @@ struct SubdiagnosticBadStr {
714711#[ diag( no_crate_example) ]
715712struct SubdiagnosticBadTwice {
716713 #[ subdiagnostic( bad, bad) ]
717- //~^ ERROR `#[subdiagnostic(...)] ` is not a valid attribute
714+ //~^ ERROR `eager ` is the only supported nested attribute for `subdiagnostic`
718715 note : Note ,
719716}
720717
721718#[ derive( Diagnostic ) ]
722719#[ diag( no_crate_example) ]
723720struct SubdiagnosticBadLitStr {
724721 #[ subdiagnostic( "bad" ) ]
725- //~^ ERROR `#[subdiagnostic(...)] ` is not a valid attribute
722+ //~^ ERROR `eager ` is the only supported nested attribute for `subdiagnostic`
726723 note : Note ,
727724}
728725
@@ -797,14 +794,15 @@ struct SuggestionsNoItem {
797794struct SuggestionsInvalidItem {
798795 #[ suggestion( code( foo) ) ]
799796 //~^ ERROR `code(...)` must contain only string literals
797+ //~| ERROR unexpected token
800798 sub : Span ,
801799}
802800
803- #[ derive( Diagnostic ) ]
801+ #[ derive( Diagnostic ) ] //~ ERROR cannot find value `__code_34` in this scope
804802#[ diag( no_crate_example) ]
805803struct SuggestionsInvalidLiteral {
806804 #[ suggestion( code = 3 ) ]
807- //~^ ERROR `code = "..."`/`code(...)` must contain only string literals
805+ //~^ ERROR expected string literal
808806 sub : Span ,
809807}
810808
0 commit comments