@@ -558,7 +558,7 @@ pub(crate) struct LinkOrdinalOutOfRange {
558
558
pub ordinal : u128 ,
559
559
}
560
560
561
- pub ( crate ) enum AttributeParseErrorReason {
561
+ pub ( crate ) enum AttributeParseErrorReason < ' a > {
562
562
ExpectedNoArgs ,
563
563
ExpectedStringLiteral {
564
564
byte_string : Option < Span > ,
@@ -571,24 +571,24 @@ pub(crate) enum AttributeParseErrorReason {
571
571
ExpectedNameValue ( Option < Symbol > ) ,
572
572
DuplicateKey ( Symbol ) ,
573
573
ExpectedSpecificArgument {
574
- possibilities : Vec < & ' static str > ,
574
+ possibilities : & ' a [ Symbol ] ,
575
575
strings : bool ,
576
576
/// Should we tell the user to write a list when they didn't?
577
577
list : bool ,
578
578
} ,
579
579
ExpectedIdentifier ,
580
580
}
581
581
582
- pub ( crate ) struct AttributeParseError {
582
+ pub ( crate ) struct AttributeParseError < ' a > {
583
583
pub ( crate ) span : Span ,
584
584
pub ( crate ) attr_span : Span ,
585
585
pub ( crate ) attr_style : AttrStyle ,
586
586
pub ( crate ) template : AttributeTemplate ,
587
587
pub ( crate ) attribute : AttrPath ,
588
- pub ( crate ) reason : AttributeParseErrorReason ,
588
+ pub ( crate ) reason : AttributeParseErrorReason < ' a > ,
589
589
}
590
590
591
- impl < ' a , G : EmissionGuarantee > Diagnostic < ' a , G > for AttributeParseError {
591
+ impl < ' a , G : EmissionGuarantee > Diagnostic < ' a , G > for AttributeParseError < ' _ > {
592
592
fn into_diag ( self , dcx : DiagCtxtHandle < ' a > , level : Level ) -> Diag < ' a , G > {
593
593
let name = self . attribute . to_string ( ) ;
594
594
@@ -657,7 +657,7 @@ impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for AttributeParseError {
657
657
list : false ,
658
658
} => {
659
659
let quote = if strings { '"' } else { '`' } ;
660
- match possibilities. as_slice ( ) {
660
+ match possibilities {
661
661
& [ ] => { }
662
662
& [ x] => {
663
663
diag. span_label (
@@ -687,7 +687,7 @@ impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for AttributeParseError {
687
687
list : true ,
688
688
} => {
689
689
let quote = if strings { '"' } else { '`' } ;
690
- match possibilities. as_slice ( ) {
690
+ match possibilities {
691
691
& [ ] => { }
692
692
& [ x] => {
693
693
diag. span_label (
0 commit comments