rustc_attr_parsing/
session_diagnostics.rs

1use std::num::IntErrorKind;
2
3use rustc_ast::{self as ast};
4use rustc_errors::codes::*;
5use rustc_errors::{
6    Applicability, Diag, DiagArgValue, DiagCtxtHandle, Diagnostic, EmissionGuarantee, Level,
7};
8use rustc_feature::AttributeTemplate;
9use rustc_hir::AttrPath;
10use rustc_macros::{Diagnostic, Subdiagnostic};
11use rustc_span::{Span, Symbol};
12use rustc_target::spec::TargetTuple;
13
14use crate::fluent_generated as fluent;
15
16#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            InvalidPredicate where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    InvalidPredicate { span: __binding_0, predicate: __binding_1
                        } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_invalid_predicate);
                        diag.code(E0537);
                        ;
                        diag.arg("predicate", __binding_1);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
17#[diag(attr_parsing_invalid_predicate, code = E0537)]
18pub(crate) struct InvalidPredicate {
19    #[primary_span]
20    pub span: Span,
21
22    pub predicate: String,
23}
24
25#[derive(const _: () =
    {
        impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
            DocAliasEmpty<'a> where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    DocAliasEmpty { span: __binding_0, attr_str: __binding_1 }
                        => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_doc_alias_empty);
                        ;
                        diag.arg("attr_str", __binding_1);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
26#[diag(attr_parsing_doc_alias_empty)]
27pub(crate) struct DocAliasEmpty<'a> {
28    #[primary_span]
29    pub span: Span,
30    pub attr_str: &'a str,
31}
32
33#[derive(const _: () =
    {
        impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
            DocAliasBadChar<'a> where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    DocAliasBadChar {
                        span: __binding_0, attr_str: __binding_1, char_: __binding_2
                        } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_doc_alias_bad_char);
                        ;
                        diag.arg("attr_str", __binding_1);
                        diag.arg("char_", __binding_2);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
34#[diag(attr_parsing_doc_alias_bad_char)]
35pub(crate) struct DocAliasBadChar<'a> {
36    #[primary_span]
37    pub span: Span,
38    pub attr_str: &'a str,
39    pub char_: char,
40}
41
42#[derive(const _: () =
    {
        impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
            DocAliasStartEnd<'a> where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    DocAliasStartEnd { span: __binding_0, attr_str: __binding_1
                        } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_doc_alias_start_end);
                        ;
                        diag.arg("attr_str", __binding_1);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
43#[diag(attr_parsing_doc_alias_start_end)]
44pub(crate) struct DocAliasStartEnd<'a> {
45    #[primary_span]
46    pub span: Span,
47    pub attr_str: &'a str,
48}
49
50#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            DocAttrNotCrateLevel where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    DocAttrNotCrateLevel {
                        span: __binding_0, attr_name: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_doc_attr_not_crate_level);
                        ;
                        diag.arg("attr_name", __binding_1);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
51#[diag(attr_parsing_doc_attr_not_crate_level)]
52pub(crate) struct DocAttrNotCrateLevel {
53    #[primary_span]
54    pub span: Span,
55    pub attr_name: Symbol,
56}
57
58#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            DocKeywordNotKeyword where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    DocKeywordNotKeyword {
                        span: __binding_0, keyword: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_doc_keyword_not_keyword);
                        diag.help(crate::fluent_generated::_subdiag::help);
                        ;
                        diag.arg("keyword", __binding_1);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
59#[diag(attr_parsing_doc_keyword_not_keyword)]
60#[help]
61pub(crate) struct DocKeywordNotKeyword {
62    #[primary_span]
63    pub span: Span,
64    pub keyword: Symbol,
65}
66
67#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            DocAttributeNotAttribute where G: rustc_errors::EmissionGuarantee
            {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    DocAttributeNotAttribute {
                        span: __binding_0, attribute: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_doc_attribute_not_attribute);
                        diag.help(crate::fluent_generated::_subdiag::help);
                        ;
                        diag.arg("attribute", __binding_1);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
68#[diag(attr_parsing_doc_attribute_not_attribute)]
69#[help]
70pub(crate) struct DocAttributeNotAttribute {
71    #[primary_span]
72    pub span: Span,
73    pub attribute: Symbol,
74}
75
76#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for MissingSince
            where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    MissingSince { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_missing_since);
                        diag.code(E0542);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
77#[diag(attr_parsing_missing_since, code = E0542)]
78pub(crate) struct MissingSince {
79    #[primary_span]
80    pub span: Span,
81}
82
83#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for MissingNote
            where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    MissingNote { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_missing_note);
                        diag.code(E0543);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
84#[diag(attr_parsing_missing_note, code = E0543)]
85pub(crate) struct MissingNote {
86    #[primary_span]
87    pub span: Span,
88}
89
90#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            MultipleStabilityLevels where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    MultipleStabilityLevels { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_multiple_stability_levels);
                        diag.code(E0544);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
91#[diag(attr_parsing_multiple_stability_levels, code = E0544)]
92pub(crate) struct MultipleStabilityLevels {
93    #[primary_span]
94    pub span: Span,
95}
96
97#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            InvalidIssueString where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    InvalidIssueString { span: __binding_0, cause: __binding_1 }
                        => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_invalid_issue_string);
                        diag.code(E0545);
                        ;
                        diag.span(__binding_0);
                        if let Some(__binding_1) = __binding_1 {
                            diag.subdiagnostic(__binding_1);
                        }
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
98#[diag(attr_parsing_invalid_issue_string, code = E0545)]
99pub(crate) struct InvalidIssueString {
100    #[primary_span]
101    pub span: Span,
102
103    #[subdiagnostic]
104    pub cause: Option<InvalidIssueStringCause>,
105}
106
107// The error kinds of `IntErrorKind` are duplicated here in order to allow the messages to be
108// translatable.
109#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for InvalidIssueStringCause {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    InvalidIssueStringCause::MustNotBeZero { span: __binding_0 }
                        => {
                        diag.store_args();
                        let __message =
                            diag.eagerly_translate(crate::fluent_generated::attr_parsing_must_not_be_zero);
                        diag.span_label(__binding_0, __message);
                        diag.restore_args();
                    }
                    InvalidIssueStringCause::Empty { span: __binding_0 } => {
                        diag.store_args();
                        let __message =
                            diag.eagerly_translate(crate::fluent_generated::attr_parsing_empty);
                        diag.span_label(__binding_0, __message);
                        diag.restore_args();
                    }
                    InvalidIssueStringCause::InvalidDigit { span: __binding_0 }
                        => {
                        diag.store_args();
                        let __message =
                            diag.eagerly_translate(crate::fluent_generated::attr_parsing_invalid_digit);
                        diag.span_label(__binding_0, __message);
                        diag.restore_args();
                    }
                    InvalidIssueStringCause::PosOverflow { span: __binding_0 }
                        => {
                        diag.store_args();
                        let __message =
                            diag.eagerly_translate(crate::fluent_generated::attr_parsing_pos_overflow);
                        diag.span_label(__binding_0, __message);
                        diag.restore_args();
                    }
                    InvalidIssueStringCause::NegOverflow { span: __binding_0 }
                        => {
                        diag.store_args();
                        let __message =
                            diag.eagerly_translate(crate::fluent_generated::attr_parsing_neg_overflow);
                        diag.span_label(__binding_0, __message);
                        diag.restore_args();
                    }
                }
            }
        }
    };Subdiagnostic)]
110pub(crate) enum InvalidIssueStringCause {
111    #[label(attr_parsing_must_not_be_zero)]
112    MustNotBeZero {
113        #[primary_span]
114        span: Span,
115    },
116
117    #[label(attr_parsing_empty)]
118    Empty {
119        #[primary_span]
120        span: Span,
121    },
122
123    #[label(attr_parsing_invalid_digit)]
124    InvalidDigit {
125        #[primary_span]
126        span: Span,
127    },
128
129    #[label(attr_parsing_pos_overflow)]
130    PosOverflow {
131        #[primary_span]
132        span: Span,
133    },
134
135    #[label(attr_parsing_neg_overflow)]
136    NegOverflow {
137        #[primary_span]
138        span: Span,
139    },
140}
141
142impl InvalidIssueStringCause {
143    pub(crate) fn from_int_error_kind(span: Span, kind: &IntErrorKind) -> Option<Self> {
144        match kind {
145            IntErrorKind::Empty => Some(Self::Empty { span }),
146            IntErrorKind::InvalidDigit => Some(Self::InvalidDigit { span }),
147            IntErrorKind::PosOverflow => Some(Self::PosOverflow { span }),
148            IntErrorKind::NegOverflow => Some(Self::NegOverflow { span }),
149            IntErrorKind::Zero => Some(Self::MustNotBeZero { span }),
150            _ => None,
151        }
152    }
153}
154
155#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for MissingFeature
            where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    MissingFeature { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_missing_feature);
                        diag.code(E0546);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
156#[diag(attr_parsing_missing_feature, code = E0546)]
157pub(crate) struct MissingFeature {
158    #[primary_span]
159    pub span: Span,
160}
161
162#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            NonIdentFeature where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    NonIdentFeature { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_non_ident_feature);
                        diag.code(E0546);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
163#[diag(attr_parsing_non_ident_feature, code = E0546)]
164pub(crate) struct NonIdentFeature {
165    #[primary_span]
166    pub span: Span,
167}
168
169#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for MissingIssue
            where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    MissingIssue { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_missing_issue);
                        diag.code(E0547);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
170#[diag(attr_parsing_missing_issue, code = E0547)]
171pub(crate) struct MissingIssue {
172    #[primary_span]
173    pub span: Span,
174}
175
176// FIXME: Why is this the same error code as `InvalidReprHintNoParen` and `InvalidReprHintNoValue`?
177// It is more similar to `IncorrectReprFormatGeneric`.
178#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            IncorrectReprFormatPackedOneOrZeroArg where
            G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    IncorrectReprFormatPackedOneOrZeroArg { span: __binding_0 }
                        => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_incorrect_repr_format_packed_one_or_zero_arg);
                        diag.code(E0552);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
179#[diag(attr_parsing_incorrect_repr_format_packed_one_or_zero_arg, code = E0552)]
180pub(crate) struct IncorrectReprFormatPackedOneOrZeroArg {
181    #[primary_span]
182    pub span: Span,
183}
184#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            IncorrectReprFormatPackedExpectInteger where
            G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    IncorrectReprFormatPackedExpectInteger { span: __binding_0 }
                        => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_incorrect_repr_format_packed_expect_integer);
                        diag.code(E0552);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
185#[diag(attr_parsing_incorrect_repr_format_packed_expect_integer, code = E0552)]
186pub(crate) struct IncorrectReprFormatPackedExpectInteger {
187    #[primary_span]
188    pub span: Span,
189}
190
191#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            InvalidReprHintNoParen where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    InvalidReprHintNoParen {
                        span: __binding_0, name: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_invalid_repr_hint_no_paren);
                        diag.code(E0552);
                        ;
                        diag.arg("name", __binding_1);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
192#[diag(attr_parsing_invalid_repr_hint_no_paren, code = E0552)]
193pub(crate) struct InvalidReprHintNoParen {
194    #[primary_span]
195    pub span: Span,
196
197    pub name: Symbol,
198}
199
200#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            InvalidReprHintNoValue where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    InvalidReprHintNoValue {
                        span: __binding_0, name: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_invalid_repr_hint_no_value);
                        diag.code(E0552);
                        ;
                        diag.arg("name", __binding_1);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
201#[diag(attr_parsing_invalid_repr_hint_no_value, code = E0552)]
202pub(crate) struct InvalidReprHintNoValue {
203    #[primary_span]
204    pub span: Span,
205
206    pub name: Symbol,
207}
208
209#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            InvalidReprAlignNeedArg where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    InvalidReprAlignNeedArg { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_invalid_repr_align_need_arg);
                        let __code_0 =
                            [::alloc::__export::must_use({
                                                ::alloc::fmt::format(format_args!("align(...)"))
                                            })].into_iter();
                        diag.code(E0589);
                        ;
                        diag.span(__binding_0);
                        diag.span_suggestions_with_style(__binding_0,
                            crate::fluent_generated::_subdiag::suggestion, __code_0,
                            rustc_errors::Applicability::HasPlaceholders,
                            rustc_errors::SuggestionStyle::ShowCode);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
210#[diag(attr_parsing_invalid_repr_align_need_arg, code = E0589)]
211pub(crate) struct InvalidReprAlignNeedArg {
212    #[primary_span]
213    #[suggestion(code = "align(...)", applicability = "has-placeholders")]
214    pub span: Span,
215}
216
217#[derive(const _: () =
    {
        impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
            InvalidReprGeneric<'a> where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    InvalidReprGeneric {
                        span: __binding_0,
                        repr_arg: __binding_1,
                        error_part: __binding_2 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_invalid_repr_generic);
                        diag.code(E0589);
                        ;
                        diag.arg("repr_arg", __binding_1);
                        diag.arg("error_part", __binding_2);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
218#[diag(attr_parsing_invalid_repr_generic, code = E0589)]
219pub(crate) struct InvalidReprGeneric<'a> {
220    #[primary_span]
221    pub span: Span,
222
223    pub repr_arg: String,
224    pub error_part: &'a str,
225}
226
227#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            IncorrectReprFormatAlignOneArg where
            G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    IncorrectReprFormatAlignOneArg { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_incorrect_repr_format_align_one_arg);
                        diag.code(E0693);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
228#[diag(attr_parsing_incorrect_repr_format_align_one_arg, code = E0693)]
229pub(crate) struct IncorrectReprFormatAlignOneArg {
230    #[primary_span]
231    pub span: Span,
232}
233
234#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            IncorrectReprFormatExpectInteger where
            G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    IncorrectReprFormatExpectInteger { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_incorrect_repr_format_expect_literal_integer);
                        diag.code(E0693);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
235#[diag(attr_parsing_incorrect_repr_format_expect_literal_integer, code = E0693)]
236pub(crate) struct IncorrectReprFormatExpectInteger {
237    #[primary_span]
238    pub span: Span,
239}
240
241#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            IncorrectReprFormatGeneric where
            G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    IncorrectReprFormatGeneric {
                        span: __binding_0, repr_arg: __binding_1, cause: __binding_2
                        } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_incorrect_repr_format_generic);
                        diag.code(E0693);
                        ;
                        diag.arg("repr_arg", __binding_1);
                        diag.span(__binding_0);
                        if let Some(__binding_2) = __binding_2 {
                            diag.subdiagnostic(__binding_2);
                        }
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
242#[diag(attr_parsing_incorrect_repr_format_generic, code = E0693)]
243pub(crate) struct IncorrectReprFormatGeneric {
244    #[primary_span]
245    pub span: Span,
246
247    pub repr_arg: Symbol,
248
249    #[subdiagnostic]
250    pub cause: Option<IncorrectReprFormatGenericCause>,
251}
252
253#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for IncorrectReprFormatGenericCause {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    IncorrectReprFormatGenericCause::Int {
                        span: __binding_0, name: __binding_1, value: __binding_2 }
                        => {
                        let __code_1 =
                            [::alloc::__export::must_use({
                                                ::alloc::fmt::format(format_args!("{0}({1})", __binding_1,
                                                        __binding_2))
                                            })].into_iter();
                        diag.store_args();
                        let __message =
                            diag.eagerly_translate(crate::fluent_generated::attr_parsing_suggestion);
                        diag.span_suggestions_with_style(__binding_0, __message,
                            __code_1, rustc_errors::Applicability::MachineApplicable,
                            rustc_errors::SuggestionStyle::ShowCode);
                        diag.restore_args();
                    }
                    IncorrectReprFormatGenericCause::Symbol {
                        span: __binding_0, name: __binding_1, value: __binding_2 }
                        => {
                        let __code_2 =
                            [::alloc::__export::must_use({
                                                ::alloc::fmt::format(format_args!("{0}({1})", __binding_1,
                                                        __binding_2))
                                            })].into_iter();
                        diag.store_args();
                        let __message =
                            diag.eagerly_translate(crate::fluent_generated::attr_parsing_suggestion);
                        diag.span_suggestions_with_style(__binding_0, __message,
                            __code_2, rustc_errors::Applicability::MachineApplicable,
                            rustc_errors::SuggestionStyle::ShowCode);
                        diag.restore_args();
                    }
                }
            }
        }
    };Subdiagnostic)]
254pub(crate) enum IncorrectReprFormatGenericCause {
255    #[suggestion(
256        attr_parsing_suggestion,
257        code = "{name}({value})",
258        applicability = "machine-applicable"
259    )]
260    Int {
261        #[primary_span]
262        span: Span,
263
264        #[skip_arg]
265        name: Symbol,
266
267        #[skip_arg]
268        value: u128,
269    },
270
271    #[suggestion(
272        attr_parsing_suggestion,
273        code = "{name}({value})",
274        applicability = "machine-applicable"
275    )]
276    Symbol {
277        #[primary_span]
278        span: Span,
279
280        #[skip_arg]
281        name: Symbol,
282
283        #[skip_arg]
284        value: Symbol,
285    },
286}
287
288impl IncorrectReprFormatGenericCause {
289    pub(crate) fn from_lit_kind(span: Span, kind: &ast::LitKind, name: Symbol) -> Option<Self> {
290        match *kind {
291            ast::LitKind::Int(value, ast::LitIntType::Unsuffixed) => {
292                Some(Self::Int { span, name, value: value.get() })
293            }
294            ast::LitKind::Str(value, _) => Some(Self::Symbol { span, name, value }),
295            _ => None,
296        }
297    }
298}
299
300#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            RustcPromotablePairing where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    RustcPromotablePairing { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_rustc_promotable_pairing);
                        diag.code(E0717);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
301#[diag(attr_parsing_rustc_promotable_pairing, code = E0717)]
302pub(crate) struct RustcPromotablePairing {
303    #[primary_span]
304    pub span: Span,
305}
306
307#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            RustcAllowedUnstablePairing where
            G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    RustcAllowedUnstablePairing { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_rustc_allowed_unstable_pairing);
                        diag.code(E0789);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
308#[diag(attr_parsing_rustc_allowed_unstable_pairing, code = E0789)]
309pub(crate) struct RustcAllowedUnstablePairing {
310    #[primary_span]
311    pub span: Span,
312}
313
314#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            DeprecatedItemSuggestion where G: rustc_errors::EmissionGuarantee
            {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    DeprecatedItemSuggestion {
                        span: __binding_0,
                        is_nightly: __binding_1,
                        details: __binding_2 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_deprecated_item_suggestion);
                        ;
                        diag.span(__binding_0);
                        if __binding_1 {
                            diag.help(crate::fluent_generated::_subdiag::help);
                        }
                        diag.note(crate::fluent_generated::_subdiag::note);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
315#[diag(attr_parsing_deprecated_item_suggestion)]
316pub(crate) struct DeprecatedItemSuggestion {
317    #[primary_span]
318    pub span: Span,
319
320    #[help]
321    pub is_nightly: bool,
322
323    #[note]
324    pub details: (),
325}
326
327#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            ExpectedSingleVersionLiteral where
            G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    ExpectedSingleVersionLiteral { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_expected_single_version_literal);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
328#[diag(attr_parsing_expected_single_version_literal)]
329pub(crate) struct ExpectedSingleVersionLiteral {
330    #[primary_span]
331    pub span: Span,
332}
333
334#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            ExpectedVersionLiteral where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    ExpectedVersionLiteral { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_expected_version_literal);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
335#[diag(attr_parsing_expected_version_literal)]
336pub(crate) struct ExpectedVersionLiteral {
337    #[primary_span]
338    pub span: Span,
339}
340
341#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            ExpectsFeatureList where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    ExpectsFeatureList { span: __binding_0, name: __binding_1 }
                        => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_expects_feature_list);
                        ;
                        diag.arg("name", __binding_1);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
342#[diag(attr_parsing_expects_feature_list)]
343pub(crate) struct ExpectsFeatureList {
344    #[primary_span]
345    pub span: Span,
346
347    pub name: String,
348}
349
350#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            ExpectsFeatures where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    ExpectsFeatures { span: __binding_0, name: __binding_1 } =>
                        {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_expects_features);
                        ;
                        diag.arg("name", __binding_1);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
351#[diag(attr_parsing_expects_features)]
352pub(crate) struct ExpectsFeatures {
353    #[primary_span]
354    pub span: Span,
355
356    pub name: String,
357}
358
359#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for InvalidSince
            where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    InvalidSince { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_invalid_since);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
360#[diag(attr_parsing_invalid_since)]
361pub(crate) struct InvalidSince {
362    #[primary_span]
363    pub span: Span,
364}
365
366#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for SoftNoArgs
            where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    SoftNoArgs { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_soft_no_args);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
367#[diag(attr_parsing_soft_no_args)]
368pub(crate) struct SoftNoArgs {
369    #[primary_span]
370    pub span: Span,
371}
372
373#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            UnknownVersionLiteral where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    UnknownVersionLiteral { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_unknown_version_literal);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
374#[diag(attr_parsing_unknown_version_literal)]
375pub(crate) struct UnknownVersionLiteral {
376    #[primary_span]
377    pub span: Span,
378}
379
380// FIXME(jdonszelmann) duplicated from `rustc_passes`, remove once `check_attr` is integrated.
381#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for UnusedMultiple
            where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    UnusedMultiple {
                        this: __binding_0, other: __binding_1, name: __binding_2 }
                        => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_unused_multiple);
                        let __code_3 =
                            [::alloc::__export::must_use({
                                                ::alloc::fmt::format(format_args!(""))
                                            })].into_iter();
                        ;
                        diag.arg("name", __binding_2);
                        diag.span(__binding_0);
                        diag.span_suggestions_with_style(__binding_0,
                            crate::fluent_generated::_subdiag::suggestion, __code_3,
                            rustc_errors::Applicability::MachineApplicable,
                            rustc_errors::SuggestionStyle::ShowCode);
                        diag.span_note(__binding_1,
                            crate::fluent_generated::_subdiag::note);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
382#[diag(attr_parsing_unused_multiple)]
383pub(crate) struct UnusedMultiple {
384    #[primary_span]
385    #[suggestion(code = "", applicability = "machine-applicable")]
386    pub this: Span,
387    #[note]
388    pub other: Span,
389    pub name: Symbol,
390}
391
392#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for NullOnExport
            where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    NullOnExport { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_null_on_export);
                        diag.code(E0648);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
393#[diag(attr_parsing_null_on_export, code = E0648)]
394pub(crate) struct NullOnExport {
395    #[primary_span]
396    pub span: Span,
397}
398
399#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            NullOnLinkSection where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    NullOnLinkSection { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_null_on_link_section);
                        diag.code(E0648);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
400#[diag(attr_parsing_null_on_link_section, code = E0648)]
401pub(crate) struct NullOnLinkSection {
402    #[primary_span]
403    pub span: Span,
404}
405
406#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            NullOnObjcClass where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    NullOnObjcClass { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_null_on_objc_class);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
407#[diag(attr_parsing_null_on_objc_class)]
408pub(crate) struct NullOnObjcClass {
409    #[primary_span]
410    pub span: Span,
411}
412
413#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            NullOnObjcSelector where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    NullOnObjcSelector { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_null_on_objc_selector);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
414#[diag(attr_parsing_null_on_objc_selector)]
415pub(crate) struct NullOnObjcSelector {
416    #[primary_span]
417    pub span: Span,
418}
419
420#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            ObjcClassExpectedStringLiteral where
            G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    ObjcClassExpectedStringLiteral { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_objc_class_expected_string_literal);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
421#[diag(attr_parsing_objc_class_expected_string_literal)]
422pub(crate) struct ObjcClassExpectedStringLiteral {
423    #[primary_span]
424    pub span: Span,
425}
426
427#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            ObjcSelectorExpectedStringLiteral where
            G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    ObjcSelectorExpectedStringLiteral { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_objc_selector_expected_string_literal);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
428#[diag(attr_parsing_objc_selector_expected_string_literal)]
429pub(crate) struct ObjcSelectorExpectedStringLiteral {
430    #[primary_span]
431    pub span: Span,
432}
433
434#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            StabilityOutsideStd where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    StabilityOutsideStd { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_stability_outside_std);
                        diag.code(E0734);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
435#[diag(attr_parsing_stability_outside_std, code = E0734)]
436pub(crate) struct StabilityOutsideStd {
437    #[primary_span]
438    pub span: Span,
439}
440
441#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            EmptyConfusables where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    EmptyConfusables { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_empty_confusables);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
442#[diag(attr_parsing_empty_confusables)]
443pub(crate) struct EmptyConfusables {
444    #[primary_span]
445    pub span: Span,
446}
447
448#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for InvalidTarget
            where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    InvalidTarget {
                        span: __binding_0,
                        name: __binding_1,
                        target: __binding_2,
                        applied: __binding_3,
                        only: __binding_4 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_invalid_target);
                        let __code_4 =
                            [::alloc::__export::must_use({
                                                ::alloc::fmt::format(format_args!(""))
                                            })].into_iter();
                        diag.help(crate::fluent_generated::_subdiag::help);
                        ;
                        diag.arg("name", __binding_1);
                        diag.arg("target", __binding_2);
                        diag.arg("applied", __binding_3);
                        diag.arg("only", __binding_4);
                        diag.span(__binding_0);
                        diag.span_suggestions_with_style(__binding_0,
                            crate::fluent_generated::_subdiag::suggestion, __code_4,
                            rustc_errors::Applicability::MachineApplicable,
                            rustc_errors::SuggestionStyle::CompletelyHidden);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
449#[help]
450#[diag(attr_parsing_invalid_target)]
451pub(crate) struct InvalidTarget {
452    #[primary_span]
453    #[suggestion(code = "", applicability = "machine-applicable", style = "tool-only")]
454    pub span: Span,
455    pub name: AttrPath,
456    pub target: &'static str,
457    pub applied: DiagArgValue,
458    pub only: &'static str,
459}
460
461#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            InvalidAlignmentValue where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    InvalidAlignmentValue {
                        span: __binding_0, error_part: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_invalid_alignment_value);
                        diag.code(E0589);
                        ;
                        diag.arg("error_part", __binding_1);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
462#[diag(attr_parsing_invalid_alignment_value, code = E0589)]
463pub(crate) struct InvalidAlignmentValue {
464    #[primary_span]
465    pub span: Span,
466    pub error_part: &'static str,
467}
468
469#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for ReprIdent
            where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    ReprIdent { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_repr_ident);
                        diag.code(E0565);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
470#[diag(attr_parsing_repr_ident, code = E0565)]
471pub(crate) struct ReprIdent {
472    #[primary_span]
473    pub span: Span,
474}
475
476#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            UnrecognizedReprHint where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    UnrecognizedReprHint { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_unrecognized_repr_hint);
                        diag.code(E0552);
                        diag.help(crate::fluent_generated::_subdiag::help);
                        diag.note(crate::fluent_generated::_subdiag::note);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
477#[diag(attr_parsing_unrecognized_repr_hint, code = E0552)]
478#[help]
479#[note]
480pub(crate) struct UnrecognizedReprHint {
481    #[primary_span]
482    pub span: Span,
483}
484
485#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            UnstableFeatureBoundIncompatibleStability where
            G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    UnstableFeatureBoundIncompatibleStability {
                        span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_unstable_feature_bound_incompatible_stability);
                        diag.help(crate::fluent_generated::_subdiag::help);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
486#[diag(attr_parsing_unstable_feature_bound_incompatible_stability)]
487#[help]
488pub(crate) struct UnstableFeatureBoundIncompatibleStability {
489    #[primary_span]
490    pub span: Span,
491}
492
493#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            NakedFunctionIncompatibleAttribute where
            G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    NakedFunctionIncompatibleAttribute {
                        span: __binding_0,
                        naked_span: __binding_1,
                        attr: __binding_2 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_naked_functions_incompatible_attribute);
                        diag.code(E0736);
                        ;
                        diag.arg("attr", __binding_2);
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            crate::fluent_generated::_subdiag::label);
                        diag.span_label(__binding_1,
                            crate::fluent_generated::attr_parsing_naked_attribute);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
494#[diag(attr_parsing_naked_functions_incompatible_attribute, code = E0736)]
495pub(crate) struct NakedFunctionIncompatibleAttribute {
496    #[primary_span]
497    #[label]
498    pub span: Span,
499    #[label(attr_parsing_naked_attribute)]
500    pub naked_span: Span,
501    pub attr: String,
502}
503
504#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            LinkOrdinalOutOfRange where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    LinkOrdinalOutOfRange {
                        span: __binding_0, ordinal: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_link_ordinal_out_of_range);
                        diag.note(crate::fluent_generated::_subdiag::note);
                        ;
                        diag.arg("ordinal", __binding_1);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
505#[diag(attr_parsing_link_ordinal_out_of_range)]
506#[note]
507pub(crate) struct LinkOrdinalOutOfRange {
508    #[primary_span]
509    pub span: Span,
510    pub ordinal: u128,
511}
512
513#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            RustcScalableVectorCountOutOfRange where
            G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    RustcScalableVectorCountOutOfRange {
                        span: __binding_0, n: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_rustc_scalable_vector_count_out_of_range);
                        diag.note(crate::fluent_generated::_subdiag::note);
                        ;
                        diag.arg("n", __binding_1);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
514#[diag(attr_parsing_rustc_scalable_vector_count_out_of_range)]
515#[note]
516pub(crate) struct RustcScalableVectorCountOutOfRange {
517    #[primary_span]
518    pub span: Span,
519    pub n: u128,
520}
521
522pub(crate) enum AttributeParseErrorReason<'a> {
523    ExpectedNoArgs,
524    ExpectedStringLiteral {
525        byte_string: Option<Span>,
526    },
527    ExpectedIntegerLiteral,
528    ExpectedAtLeastOneArgument,
529    ExpectedSingleArgument,
530    ExpectedList,
531    ExpectedListOrNoArgs,
532    ExpectedListWithNumArgsOrMore {
533        args: usize,
534    },
535    ExpectedNameValueOrNoArgs,
536    ExpectedNonEmptyStringLiteral,
537    UnexpectedLiteral,
538    ExpectedNameValue(Option<Symbol>),
539    DuplicateKey(Symbol),
540    ExpectedSpecificArgument {
541        possibilities: &'a [Symbol],
542        strings: bool,
543        /// Should we tell the user to write a list when they didn't?
544        list: bool,
545    },
546    ExpectedIdentifier,
547}
548
549/// A description of a thing that can be parsed using an attribute parser.
550#[derive(#[automatically_derived]
impl ::core::marker::Copy for ParsedDescription { }Copy, #[automatically_derived]
impl ::core::clone::Clone for ParsedDescription {
    #[inline]
    fn clone(&self) -> ParsedDescription { *self }
}Clone)]
551pub enum ParsedDescription {
552    /// Used when parsing attributes.
553    Attribute,
554    /// Used when parsing some macros, such as the `cfg!()` macro.
555    Macro,
556}
557
558pub(crate) struct AttributeParseError<'a> {
559    pub(crate) span: Span,
560    pub(crate) attr_span: Span,
561    pub(crate) template: AttributeTemplate,
562    pub(crate) path: AttrPath,
563    pub(crate) description: ParsedDescription,
564    pub(crate) reason: AttributeParseErrorReason<'a>,
565    pub(crate) suggestions: Vec<String>,
566}
567
568impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for AttributeParseError<'_> {
569    fn into_diag(self, dcx: DiagCtxtHandle<'a>, level: Level) -> Diag<'a, G> {
570        let name = self.path.to_string();
571
572        let description = match self.description {
573            ParsedDescription::Attribute => "attribute",
574            ParsedDescription::Macro => "macro",
575        };
576
577        let mut diag = Diag::new(dcx, level, ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("malformed `{0}` {1} input", name,
                description))
    })format!("malformed `{name}` {description} input"));
578        diag.span(self.attr_span);
579        diag.code(E0539);
580        match self.reason {
581            AttributeParseErrorReason::ExpectedStringLiteral { byte_string } => {
582                if let Some(start_point_span) = byte_string {
583                    diag.span_suggestion(
584                        start_point_span,
585                        fluent::attr_parsing_unsupported_literal_suggestion,
586                        "",
587                        Applicability::MaybeIncorrect,
588                    );
589                    diag.note("expected a normal string literal, not a byte string literal");
590
591                    return diag;
592                } else {
593                    diag.span_label(self.span, "expected a string literal here");
594                }
595            }
596            AttributeParseErrorReason::ExpectedIntegerLiteral => {
597                diag.span_label(self.span, "expected an integer literal here");
598            }
599            AttributeParseErrorReason::ExpectedSingleArgument => {
600                diag.span_label(self.span, "expected a single argument here");
601                diag.code(E0805);
602            }
603            AttributeParseErrorReason::ExpectedAtLeastOneArgument => {
604                diag.span_label(self.span, "expected at least 1 argument here");
605            }
606            AttributeParseErrorReason::ExpectedList => {
607                diag.span_label(self.span, "expected this to be a list");
608            }
609            AttributeParseErrorReason::ExpectedListOrNoArgs => {
610                diag.span_label(self.span, "expected a list or no arguments here");
611            }
612            AttributeParseErrorReason::ExpectedListWithNumArgsOrMore { args } => {
613                diag.span_label(self.span, ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("expected {0} or more items", args))
    })format!("expected {args} or more items"));
614            }
615            AttributeParseErrorReason::ExpectedNameValueOrNoArgs => {
616                diag.span_label(self.span, "didn't expect a list here");
617            }
618            AttributeParseErrorReason::ExpectedNonEmptyStringLiteral => {
619                diag.span_label(self.span, "string is not allowed to be empty");
620            }
621            AttributeParseErrorReason::DuplicateKey(key) => {
622                diag.span_label(self.span, ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("found `{0}` used as a key more than once",
                key))
    })format!("found `{key}` used as a key more than once"));
623                diag.code(E0538);
624            }
625            AttributeParseErrorReason::UnexpectedLiteral => {
626                diag.span_label(self.span, "didn't expect a literal here");
627                diag.code(E0565);
628            }
629            AttributeParseErrorReason::ExpectedNoArgs => {
630                diag.span_label(self.span, "didn't expect any arguments here");
631                diag.code(E0565);
632            }
633            AttributeParseErrorReason::ExpectedNameValue(None) => {
634                // If the span is the entire attribute, the suggestion we add below this match already contains enough information
635                if self.span != self.attr_span {
636                    diag.span_label(
637                        self.span,
638                        ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("expected this to be of the form `... = \"...\"`"))
    })format!("expected this to be of the form `... = \"...\"`"),
639                    );
640                }
641            }
642            AttributeParseErrorReason::ExpectedNameValue(Some(name)) => {
643                diag.span_label(
644                    self.span,
645                    ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("expected this to be of the form `{0} = \"...\"`",
                name))
    })format!("expected this to be of the form `{name} = \"...\"`"),
646                );
647            }
648            AttributeParseErrorReason::ExpectedSpecificArgument {
649                possibilities,
650                strings,
651                list: false,
652            } => {
653                let quote = if strings { '"' } else { '`' };
654                match possibilities {
655                    &[] => {}
656                    &[x] => {
657                        diag.span_label(
658                            self.span,
659                            ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("the only valid argument here is {0}{1}{0}",
                quote, x))
    })format!("the only valid argument here is {quote}{x}{quote}"),
660                        );
661                    }
662                    [first, second] => {
663                        diag.span_label(self.span, ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("valid arguments are {0}{1}{0} or {0}{2}{0}",
                quote, first, second))
    })format!("valid arguments are {quote}{first}{quote} or {quote}{second}{quote}"));
664                    }
665                    [first @ .., second_to_last, last] => {
666                        let mut res = String::new();
667                        for i in first {
668                            res.push_str(&::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("{0}{1}{0}, ", quote, i))
    })format!("{quote}{i}{quote}, "));
669                        }
670                        res.push_str(&::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("{0}{1}{0} or {0}{2}{0}", quote,
                second_to_last, last))
    })format!(
671                            "{quote}{second_to_last}{quote} or {quote}{last}{quote}"
672                        ));
673
674                        diag.span_label(self.span, ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("valid arguments are {0}", res))
    })format!("valid arguments are {res}"));
675                    }
676                }
677            }
678            AttributeParseErrorReason::ExpectedSpecificArgument {
679                possibilities,
680                strings,
681                list: true,
682            } => {
683                let quote = if strings { '"' } else { '`' };
684                match possibilities {
685                    &[] => {}
686                    &[x] => {
687                        diag.span_label(
688                            self.span,
689                            ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("this {0} is only valid with {1}{2}{1} as an argument",
                description, quote, x))
    })format!(
690                                "this {description} is only valid with {quote}{x}{quote} as an argument"
691                            ),
692                        );
693                    }
694                    [first, second] => {
695                        diag.span_label(self.span, ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("this {0} is only valid with either {1}{2}{1} or {1}{3}{1} as an argument",
                description, quote, first, second))
    })format!("this {description} is only valid with either {quote}{first}{quote} or {quote}{second}{quote} as an argument"));
696                    }
697                    [first @ .., second_to_last, last] => {
698                        let mut res = String::new();
699                        for i in first {
700                            res.push_str(&::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("{0}{1}{0}, ", quote, i))
    })format!("{quote}{i}{quote}, "));
701                        }
702                        res.push_str(&::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("{0}{1}{0} or {0}{2}{0}", quote,
                second_to_last, last))
    })format!(
703                            "{quote}{second_to_last}{quote} or {quote}{last}{quote}"
704                        ));
705
706                        diag.span_label(self.span, ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("this {0} is only valid with one of the following arguments: {1}",
                description, res))
    })format!("this {description} is only valid with one of the following arguments: {res}"));
707                    }
708                }
709            }
710            AttributeParseErrorReason::ExpectedIdentifier => {
711                diag.span_label(self.span, "expected a valid identifier here");
712            }
713        }
714
715        if let Some(link) = self.template.docs {
716            diag.note(::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("for more information, visit <{0}>",
                link))
    })format!("for more information, visit <{link}>"));
717        }
718
719        if self.suggestions.len() < 4 {
720            diag.span_suggestions(
721                self.attr_span,
722                if self.suggestions.len() == 1 {
723                    "must be of the form".to_string()
724                } else {
725                    ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("try changing it to one of the following valid forms of the {0}",
                description))
    })format!(
726                        "try changing it to one of the following valid forms of the {description}"
727                    )
728                },
729                self.suggestions,
730                Applicability::HasPlaceholders,
731            );
732        }
733
734        diag
735    }
736}
737
738#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            InvalidAttrUnsafe where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    InvalidAttrUnsafe { span: __binding_0, name: __binding_1 }
                        => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_invalid_attr_unsafe);
                        diag.note(crate::fluent_generated::_subdiag::note);
                        ;
                        diag.arg("name", __binding_1);
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            crate::fluent_generated::_subdiag::label);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
739#[diag(attr_parsing_invalid_attr_unsafe)]
740#[note]
741pub(crate) struct InvalidAttrUnsafe {
742    #[primary_span]
743    #[label]
744    pub span: Span,
745    pub name: AttrPath,
746}
747
748#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            UnsafeAttrOutsideUnsafe where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    UnsafeAttrOutsideUnsafe {
                        span: __binding_0, suggestion: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_unsafe_attr_outside_unsafe);
                        ;
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            crate::fluent_generated::_subdiag::label);
                        if let Some(__binding_1) = __binding_1 {
                            diag.subdiagnostic(__binding_1);
                        }
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
749#[diag(attr_parsing_unsafe_attr_outside_unsafe)]
750pub(crate) struct UnsafeAttrOutsideUnsafe {
751    #[primary_span]
752    #[label]
753    pub span: Span,
754    #[subdiagnostic]
755    pub suggestion: Option<UnsafeAttrOutsideUnsafeSuggestion>,
756}
757
758#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for UnsafeAttrOutsideUnsafeSuggestion
            {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    UnsafeAttrOutsideUnsafeSuggestion {
                        left: __binding_0, right: __binding_1 } => {
                        let mut suggestions = Vec::new();
                        let __code_5 =
                            ::alloc::__export::must_use({
                                    ::alloc::fmt::format(format_args!("unsafe("))
                                });
                        let __code_6 =
                            ::alloc::__export::must_use({
                                    ::alloc::fmt::format(format_args!(")"))
                                });
                        suggestions.push((__binding_0, __code_5));
                        suggestions.push((__binding_1, __code_6));
                        diag.store_args();
                        let __message =
                            diag.eagerly_translate(crate::fluent_generated::attr_parsing_unsafe_attr_outside_unsafe_suggestion);
                        diag.multipart_suggestion_with_style(__message, suggestions,
                            rustc_errors::Applicability::MachineApplicable,
                            rustc_errors::SuggestionStyle::ShowCode);
                        diag.restore_args();
                    }
                }
            }
        }
    };Subdiagnostic)]
759#[multipart_suggestion(
760    attr_parsing_unsafe_attr_outside_unsafe_suggestion,
761    applicability = "machine-applicable"
762)]
763pub(crate) struct UnsafeAttrOutsideUnsafeSuggestion {
764    #[suggestion_part(code = "unsafe(")]
765    pub left: Span,
766    #[suggestion_part(code = ")")]
767    pub right: Span,
768}
769
770#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for MetaBadDelim
            where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    MetaBadDelim { span: __binding_0, sugg: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_meta_bad_delim);
                        ;
                        diag.span(__binding_0);
                        diag.subdiagnostic(__binding_1);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
771#[diag(attr_parsing_meta_bad_delim)]
772pub(crate) struct MetaBadDelim {
773    #[primary_span]
774    pub span: Span,
775    #[subdiagnostic]
776    pub sugg: MetaBadDelimSugg,
777}
778
779#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for MetaBadDelimSugg {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    MetaBadDelimSugg { open: __binding_0, close: __binding_1 }
                        => {
                        let mut suggestions = Vec::new();
                        let __code_7 =
                            ::alloc::__export::must_use({
                                    ::alloc::fmt::format(format_args!("("))
                                });
                        let __code_8 =
                            ::alloc::__export::must_use({
                                    ::alloc::fmt::format(format_args!(")"))
                                });
                        suggestions.push((__binding_0, __code_7));
                        suggestions.push((__binding_1, __code_8));
                        diag.store_args();
                        let __message =
                            diag.eagerly_translate(crate::fluent_generated::attr_parsing_meta_bad_delim_suggestion);
                        diag.multipart_suggestion_with_style(__message, suggestions,
                            rustc_errors::Applicability::MachineApplicable,
                            rustc_errors::SuggestionStyle::ShowCode);
                        diag.restore_args();
                    }
                }
            }
        }
    };Subdiagnostic)]
780#[multipart_suggestion(
781    attr_parsing_meta_bad_delim_suggestion,
782    applicability = "machine-applicable"
783)]
784pub(crate) struct MetaBadDelimSugg {
785    #[suggestion_part(code = "(")]
786    pub open: Span,
787    #[suggestion_part(code = ")")]
788    pub close: Span,
789}
790
791#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            InvalidMetaItem where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    InvalidMetaItem {
                        span: __binding_0,
                        descr: __binding_1,
                        quote_ident_sugg: __binding_2,
                        remove_neg_sugg: __binding_3,
                        label: __binding_4 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_invalid_meta_item);
                        ;
                        diag.arg("descr", __binding_1);
                        diag.span(__binding_0);
                        if let Some(__binding_2) = __binding_2 {
                            diag.subdiagnostic(__binding_2);
                        }
                        if let Some(__binding_3) = __binding_3 {
                            diag.subdiagnostic(__binding_3);
                        }
                        if let Some(__binding_4) = __binding_4 {
                            diag.span_label(__binding_4,
                                crate::fluent_generated::_subdiag::label);
                        }
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
792#[diag(attr_parsing_invalid_meta_item)]
793pub(crate) struct InvalidMetaItem {
794    #[primary_span]
795    pub span: Span,
796    pub descr: String,
797    #[subdiagnostic]
798    pub quote_ident_sugg: Option<InvalidMetaItemQuoteIdentSugg>,
799    #[subdiagnostic]
800    pub remove_neg_sugg: Option<InvalidMetaItemRemoveNegSugg>,
801    #[label]
802    pub label: Option<Span>,
803}
804
805#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for InvalidMetaItemQuoteIdentSugg {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    InvalidMetaItemQuoteIdentSugg {
                        before: __binding_0, after: __binding_1 } => {
                        let mut suggestions = Vec::new();
                        let __code_9 =
                            ::alloc::__export::must_use({
                                    ::alloc::fmt::format(format_args!("\""))
                                });
                        let __code_10 =
                            ::alloc::__export::must_use({
                                    ::alloc::fmt::format(format_args!("\""))
                                });
                        suggestions.push((__binding_0, __code_9));
                        suggestions.push((__binding_1, __code_10));
                        diag.store_args();
                        let __message =
                            diag.eagerly_translate(crate::fluent_generated::attr_parsing_quote_ident_sugg);
                        diag.multipart_suggestion_with_style(__message, suggestions,
                            rustc_errors::Applicability::MachineApplicable,
                            rustc_errors::SuggestionStyle::ShowCode);
                        diag.restore_args();
                    }
                }
            }
        }
    };Subdiagnostic)]
806#[multipart_suggestion(attr_parsing_quote_ident_sugg, applicability = "machine-applicable")]
807pub(crate) struct InvalidMetaItemQuoteIdentSugg {
808    #[suggestion_part(code = "\"")]
809    pub before: Span,
810    #[suggestion_part(code = "\"")]
811    pub after: Span,
812}
813
814#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for InvalidMetaItemRemoveNegSugg {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    InvalidMetaItemRemoveNegSugg { negative_sign: __binding_0 }
                        => {
                        let mut suggestions = Vec::new();
                        let __code_11 =
                            ::alloc::__export::must_use({
                                    ::alloc::fmt::format(format_args!(""))
                                });
                        suggestions.push((__binding_0, __code_11));
                        diag.store_args();
                        let __message =
                            diag.eagerly_translate(crate::fluent_generated::attr_parsing_remove_neg_sugg);
                        diag.multipart_suggestion_with_style(__message, suggestions,
                            rustc_errors::Applicability::MachineApplicable,
                            rustc_errors::SuggestionStyle::ShowCode);
                        diag.restore_args();
                    }
                }
            }
        }
    };Subdiagnostic)]
815#[multipart_suggestion(attr_parsing_remove_neg_sugg, applicability = "machine-applicable")]
816pub(crate) struct InvalidMetaItemRemoveNegSugg {
817    #[suggestion_part(code = "")]
818    pub negative_sign: Span,
819}
820
821#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            SuffixedLiteralInAttribute where
            G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    SuffixedLiteralInAttribute { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_suffixed_literal_in_attribute);
                        diag.help(crate::fluent_generated::_subdiag::help);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
822#[diag(attr_parsing_suffixed_literal_in_attribute)]
823#[help]
824pub(crate) struct SuffixedLiteralInAttribute {
825    #[primary_span]
826    pub span: Span,
827}
828
829#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for EmptyLinkName
            where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    EmptyLinkName { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_empty_link_name);
                        diag.code(E0454);
                        ;
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            crate::fluent_generated::_subdiag::label);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
830#[diag(attr_parsing_empty_link_name, code = E0454)]
831pub(crate) struct EmptyLinkName {
832    #[primary_span]
833    #[label]
834    pub span: Span,
835}
836
837#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            LinkFrameworkApple where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    LinkFrameworkApple { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_link_framework_apple);
                        diag.code(E0455);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
838#[diag(attr_parsing_link_framework_apple, code = E0455)]
839pub(crate) struct LinkFrameworkApple {
840    #[primary_span]
841    pub span: Span,
842}
843
844#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            IncompatibleWasmLink where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    IncompatibleWasmLink { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_incompatible_wasm_link);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
845#[diag(attr_parsing_incompatible_wasm_link)]
846pub(crate) struct IncompatibleWasmLink {
847    #[primary_span]
848    pub span: Span,
849}
850
851#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            LinkRequiresName where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    LinkRequiresName { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_link_requires_name);
                        diag.code(E0459);
                        ;
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            crate::fluent_generated::_subdiag::label);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
852#[diag(attr_parsing_link_requires_name, code = E0459)]
853pub(crate) struct LinkRequiresName {
854    #[primary_span]
855    #[label]
856    pub span: Span,
857}
858
859#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for RawDylibNoNul
            where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    RawDylibNoNul { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_raw_dylib_no_nul);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
860#[diag(attr_parsing_raw_dylib_no_nul)]
861pub(crate) struct RawDylibNoNul {
862    #[primary_span]
863    pub span: Span,
864}
865
866#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            RawDylibOnlyWindows where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    RawDylibOnlyWindows { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_raw_dylib_only_windows);
                        diag.code(E0455);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
867#[diag(attr_parsing_raw_dylib_only_windows, code = E0455)]
868pub(crate) struct RawDylibOnlyWindows {
869    #[primary_span]
870    pub span: Span,
871}
872
873#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            InvalidLinkModifier where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    InvalidLinkModifier { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_invalid_link_modifier);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
874#[diag(attr_parsing_invalid_link_modifier)]
875pub(crate) struct InvalidLinkModifier {
876    #[primary_span]
877    pub span: Span,
878}
879
880#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            MultipleModifiers where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    MultipleModifiers { span: __binding_0, modifier: __binding_1
                        } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_multiple_modifiers);
                        ;
                        diag.arg("modifier", __binding_1);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
881#[diag(attr_parsing_multiple_modifiers)]
882pub(crate) struct MultipleModifiers {
883    #[primary_span]
884    pub span: Span,
885    pub modifier: Symbol,
886}
887
888#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            ImportNameTypeX86 where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    ImportNameTypeX86 { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_import_name_type_x86);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
889#[diag(attr_parsing_import_name_type_x86)]
890pub(crate) struct ImportNameTypeX86 {
891    #[primary_span]
892    pub span: Span,
893}
894
895#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            BundleNeedsStatic where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    BundleNeedsStatic { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_bundle_needs_static);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
896#[diag(attr_parsing_bundle_needs_static)]
897pub(crate) struct BundleNeedsStatic {
898    #[primary_span]
899    pub span: Span,
900}
901
902#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            WholeArchiveNeedsStatic where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    WholeArchiveNeedsStatic { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_whole_archive_needs_static);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
903#[diag(attr_parsing_whole_archive_needs_static)]
904pub(crate) struct WholeArchiveNeedsStatic {
905    #[primary_span]
906    pub span: Span,
907}
908
909#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            AsNeededCompatibility where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    AsNeededCompatibility { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_as_needed_compatibility);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
910#[diag(attr_parsing_as_needed_compatibility)]
911pub(crate) struct AsNeededCompatibility {
912    #[primary_span]
913    pub span: Span,
914}
915
916#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            ImportNameTypeRaw where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    ImportNameTypeRaw { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_import_name_type_raw);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
917#[diag(attr_parsing_import_name_type_raw)]
918pub(crate) struct ImportNameTypeRaw {
919    #[primary_span]
920    pub span: Span,
921}
922
923#[derive(const _: () =
    {
        impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
            LimitInvalid<'a> where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    LimitInvalid {
                        span: __binding_0,
                        value_span: __binding_1,
                        error_str: __binding_2 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_limit_invalid);
                        ;
                        diag.arg("error_str", __binding_2);
                        diag.span(__binding_0);
                        diag.span_label(__binding_1,
                            crate::fluent_generated::_subdiag::label);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
924#[diag(attr_parsing_limit_invalid)]
925pub(crate) struct LimitInvalid<'a> {
926    #[primary_span]
927    pub span: Span,
928    #[label]
929    pub value_span: Span,
930    pub error_str: &'a str,
931}
932
933#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            CfgAttrBadDelim where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    CfgAttrBadDelim { span: __binding_0, sugg: __binding_1 } =>
                        {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_cfg_attr_bad_delim);
                        ;
                        diag.span(__binding_0);
                        diag.subdiagnostic(__binding_1);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
934#[diag(attr_parsing_cfg_attr_bad_delim)]
935pub(crate) struct CfgAttrBadDelim {
936    #[primary_span]
937    pub span: Span,
938    #[subdiagnostic]
939    pub sugg: MetaBadDelimSugg,
940}
941
942#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            DocAliasMalformed where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    DocAliasMalformed { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_doc_alias_malformed);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
943#[diag(attr_parsing_doc_alias_malformed)]
944pub(crate) struct DocAliasMalformed {
945    #[primary_span]
946    pub span: Span,
947}
948
949#[derive(const _: () =
    {
        impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
            UnsupportedInstructionSet<'a> where
            G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    UnsupportedInstructionSet {
                        span: __binding_0,
                        instruction_set: __binding_1,
                        current_target: __binding_2 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::attr_parsing_unsupported_instruction_set);
                        ;
                        diag.arg("instruction_set", __binding_1);
                        diag.arg("current_target", __binding_2);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
950#[diag(attr_parsing_unsupported_instruction_set)]
951pub(crate) struct UnsupportedInstructionSet<'a> {
952    #[primary_span]
953    pub span: Span,
954    pub instruction_set: Symbol,
955    pub current_target: &'a TargetTuple,
956}