@@ -558,7 +558,7 @@ pub(crate) struct LinkOrdinalOutOfRange {
558558 pub ordinal: u128,
559559}
560560
561- pub(crate) enum AttributeParseErrorReason {
561+ pub(crate) enum AttributeParseErrorReason<'a> {
562562 ExpectedNoArgs,
563563 ExpectedStringLiteral {
564564 byte_string: Option<Span>,
@@ -571,24 +571,24 @@ pub(crate) enum AttributeParseErrorReason {
571571 ExpectedNameValue(Option<Symbol>),
572572 DuplicateKey(Symbol),
573573 ExpectedSpecificArgument {
574- possibilities: Vec<&'static str> ,
574+ possibilities: &'a [Symbol] ,
575575 strings: bool,
576576 /// Should we tell the user to write a list when they didn't?
577577 list: bool,
578578 },
579579 ExpectedIdentifier,
580580}
581581
582- pub(crate) struct AttributeParseError {
582+ pub(crate) struct AttributeParseError<'a> {
583583 pub(crate) span: Span,
584584 pub(crate) attr_span: Span,
585585 pub(crate) attr_style: AttrStyle,
586586 pub(crate) template: AttributeTemplate,
587587 pub(crate) attribute: AttrPath,
588- pub(crate) reason: AttributeParseErrorReason,
588+ pub(crate) reason: AttributeParseErrorReason<'a> ,
589589}
590590
591- impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for AttributeParseError {
591+ impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for AttributeParseError<'_> {
592592 fn into_diag(self, dcx: DiagCtxtHandle<'a>, level: Level) -> Diag<'a, G> {
593593 let name = self.attribute.to_string();
594594
@@ -657,7 +657,7 @@ impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for AttributeParseError {
657657 list: false,
658658 } => {
659659 let quote = if strings { '"' } else { '`' };
660- match possibilities.as_slice() {
660+ match possibilities {
661661 &[] => {}
662662 &[x] => {
663663 diag.span_label(
@@ -687,7 +687,7 @@ impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for AttributeParseError {
687687 list: true,
688688 } => {
689689 let quote = if strings { '"' } else { '`' };
690- match possibilities.as_slice() {
690+ match possibilities {
691691 &[] => {}
692692 &[x] => {
693693 diag.span_label(
0 commit comments