Skip to main content

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    ExpectedIntegerLiteralInRange {
529        lower_bound: isize,
530        upper_bound: isize,
531    },
532    ExpectedAtLeastOneArgument,
533    ExpectedSingleArgument,
534    ExpectedList,
535    ExpectedListOrNoArgs,
536    ExpectedListWithNumArgsOrMore {
537        args: usize,
538    },
539    ExpectedNameValueOrNoArgs,
540    ExpectedNonEmptyStringLiteral,
541    UnexpectedLiteral,
542    ExpectedNameValue(Option<Symbol>),
543    DuplicateKey(Symbol),
544    ExpectedSpecificArgument {
545        possibilities: &'a [Symbol],
546        strings: bool,
547        /// Should we tell the user to write a list when they didn't?
548        list: bool,
549    },
550    ExpectedIdentifier,
551}
552
553/// A description of a thing that can be parsed using an attribute parser.
554#[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)]
555pub enum ParsedDescription {
556    /// Used when parsing attributes.
557    Attribute,
558    /// Used when parsing some macros, such as the `cfg!()` macro.
559    Macro,
560}
561
562pub(crate) struct AttributeParseError<'a> {
563    pub(crate) span: Span,
564    pub(crate) attr_span: Span,
565    pub(crate) template: AttributeTemplate,
566    pub(crate) path: AttrPath,
567    pub(crate) description: ParsedDescription,
568    pub(crate) reason: AttributeParseErrorReason<'a>,
569    pub(crate) suggestions: Vec<String>,
570}
571
572impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for AttributeParseError<'_> {
573    fn into_diag(self, dcx: DiagCtxtHandle<'a>, level: Level) -> Diag<'a, G> {
574        let name = self.path.to_string();
575
576        let description = match self.description {
577            ParsedDescription::Attribute => "attribute",
578            ParsedDescription::Macro => "macro",
579        };
580
581        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"));
582        diag.span(self.attr_span);
583        diag.code(E0539);
584        match self.reason {
585            AttributeParseErrorReason::ExpectedStringLiteral { byte_string } => {
586                if let Some(start_point_span) = byte_string {
587                    diag.span_suggestion(
588                        start_point_span,
589                        fluent::attr_parsing_unsupported_literal_suggestion,
590                        "",
591                        Applicability::MaybeIncorrect,
592                    );
593                    diag.note("expected a normal string literal, not a byte string literal");
594
595                    return diag;
596                } else {
597                    diag.span_label(self.span, "expected a string literal here");
598                }
599            }
600            AttributeParseErrorReason::ExpectedIntegerLiteral => {
601                diag.span_label(self.span, "expected an integer literal here");
602            }
603            AttributeParseErrorReason::ExpectedIntegerLiteralInRange {
604                lower_bound,
605                upper_bound,
606            } => {
607                diag.span_label(
608                    self.span,
609                    ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("expected an integer literal in the range of {0}..={1}",
                lower_bound, upper_bound))
    })format!(
610                        "expected an integer literal in the range of {lower_bound}..={upper_bound}"
611                    ),
612                );
613            }
614            AttributeParseErrorReason::ExpectedSingleArgument => {
615                diag.span_label(self.span, "expected a single argument here");
616                diag.code(E0805);
617            }
618            AttributeParseErrorReason::ExpectedAtLeastOneArgument => {
619                diag.span_label(self.span, "expected at least 1 argument here");
620            }
621            AttributeParseErrorReason::ExpectedList => {
622                diag.span_label(self.span, "expected this to be a list");
623            }
624            AttributeParseErrorReason::ExpectedListOrNoArgs => {
625                diag.span_label(self.span, "expected a list or no arguments here");
626            }
627            AttributeParseErrorReason::ExpectedListWithNumArgsOrMore { args } => {
628                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"));
629            }
630            AttributeParseErrorReason::ExpectedNameValueOrNoArgs => {
631                diag.span_label(self.span, "didn't expect a list here");
632            }
633            AttributeParseErrorReason::ExpectedNonEmptyStringLiteral => {
634                diag.span_label(self.span, "string is not allowed to be empty");
635            }
636            AttributeParseErrorReason::DuplicateKey(key) => {
637                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"));
638                diag.code(E0538);
639            }
640            AttributeParseErrorReason::UnexpectedLiteral => {
641                diag.span_label(self.span, "didn't expect a literal here");
642                diag.code(E0565);
643            }
644            AttributeParseErrorReason::ExpectedNoArgs => {
645                diag.span_label(self.span, "didn't expect any arguments here");
646                diag.code(E0565);
647            }
648            AttributeParseErrorReason::ExpectedNameValue(None) => {
649                // If the span is the entire attribute, the suggestion we add below this match already contains enough information
650                if self.span != self.attr_span {
651                    diag.span_label(
652                        self.span,
653                        ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("expected this to be of the form `... = \"...\"`"))
    })format!("expected this to be of the form `... = \"...\"`"),
654                    );
655                }
656            }
657            AttributeParseErrorReason::ExpectedNameValue(Some(name)) => {
658                diag.span_label(
659                    self.span,
660                    ::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} = \"...\"`"),
661                );
662            }
663            AttributeParseErrorReason::ExpectedSpecificArgument {
664                possibilities,
665                strings,
666                list: false,
667            } => {
668                let quote = if strings { '"' } else { '`' };
669                match possibilities {
670                    &[] => {}
671                    &[x] => {
672                        diag.span_label(
673                            self.span,
674                            ::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}"),
675                        );
676                    }
677                    [first, second] => {
678                        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}"));
679                    }
680                    [first @ .., second_to_last, last] => {
681                        let mut res = String::new();
682                        for i in first {
683                            res.push_str(&::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("{0}{1}{0}, ", quote, i))
    })format!("{quote}{i}{quote}, "));
684                        }
685                        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!(
686                            "{quote}{second_to_last}{quote} or {quote}{last}{quote}"
687                        ));
688
689                        diag.span_label(self.span, ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("valid arguments are {0}", res))
    })format!("valid arguments are {res}"));
690                    }
691                }
692            }
693            AttributeParseErrorReason::ExpectedSpecificArgument {
694                possibilities,
695                strings,
696                list: true,
697            } => {
698                let quote = if strings { '"' } else { '`' };
699                match possibilities {
700                    &[] => {}
701                    &[x] => {
702                        diag.span_label(
703                            self.span,
704                            ::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!(
705                                "this {description} is only valid with {quote}{x}{quote} as an argument"
706                            ),
707                        );
708                    }
709                    [first, second] => {
710                        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"));
711                    }
712                    [first @ .., second_to_last, last] => {
713                        let mut res = String::new();
714                        for i in first {
715                            res.push_str(&::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("{0}{1}{0}, ", quote, i))
    })format!("{quote}{i}{quote}, "));
716                        }
717                        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!(
718                            "{quote}{second_to_last}{quote} or {quote}{last}{quote}"
719                        ));
720
721                        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}"));
722                    }
723                }
724            }
725            AttributeParseErrorReason::ExpectedIdentifier => {
726                diag.span_label(self.span, "expected a valid identifier here");
727            }
728        }
729
730        if let Some(link) = self.template.docs {
731            diag.note(::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("for more information, visit <{0}>",
                link))
    })format!("for more information, visit <{link}>"));
732        }
733
734        if self.suggestions.len() < 4 {
735            diag.span_suggestions(
736                self.attr_span,
737                if self.suggestions.len() == 1 {
738                    "must be of the form".to_string()
739                } else {
740                    ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("try changing it to one of the following valid forms of the {0}",
                description))
    })format!(
741                        "try changing it to one of the following valid forms of the {description}"
742                    )
743                },
744                self.suggestions,
745                Applicability::HasPlaceholders,
746            );
747        }
748
749        diag
750    }
751}
752
753#[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)]
754#[diag(attr_parsing_invalid_attr_unsafe)]
755#[note]
756pub(crate) struct InvalidAttrUnsafe {
757    #[primary_span]
758    #[label]
759    pub span: Span,
760    pub name: AttrPath,
761}
762
763#[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)]
764#[diag(attr_parsing_unsafe_attr_outside_unsafe)]
765pub(crate) struct UnsafeAttrOutsideUnsafe {
766    #[primary_span]
767    #[label]
768    pub span: Span,
769    #[subdiagnostic]
770    pub suggestion: Option<UnsafeAttrOutsideUnsafeSuggestion>,
771}
772
773#[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)]
774#[multipart_suggestion(
775    attr_parsing_unsafe_attr_outside_unsafe_suggestion,
776    applicability = "machine-applicable"
777)]
778pub(crate) struct UnsafeAttrOutsideUnsafeSuggestion {
779    #[suggestion_part(code = "unsafe(")]
780    pub left: Span,
781    #[suggestion_part(code = ")")]
782    pub right: Span,
783}
784
785#[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)]
786#[diag(attr_parsing_meta_bad_delim)]
787pub(crate) struct MetaBadDelim {
788    #[primary_span]
789    pub span: Span,
790    #[subdiagnostic]
791    pub sugg: MetaBadDelimSugg,
792}
793
794#[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)]
795#[multipart_suggestion(
796    attr_parsing_meta_bad_delim_suggestion,
797    applicability = "machine-applicable"
798)]
799pub(crate) struct MetaBadDelimSugg {
800    #[suggestion_part(code = "(")]
801    pub open: Span,
802    #[suggestion_part(code = ")")]
803    pub close: Span,
804}
805
806#[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)]
807#[diag(attr_parsing_invalid_meta_item)]
808pub(crate) struct InvalidMetaItem {
809    #[primary_span]
810    pub span: Span,
811    pub descr: String,
812    #[subdiagnostic]
813    pub quote_ident_sugg: Option<InvalidMetaItemQuoteIdentSugg>,
814    #[subdiagnostic]
815    pub remove_neg_sugg: Option<InvalidMetaItemRemoveNegSugg>,
816    #[label]
817    pub label: Option<Span>,
818}
819
820#[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)]
821#[multipart_suggestion(attr_parsing_quote_ident_sugg, applicability = "machine-applicable")]
822pub(crate) struct InvalidMetaItemQuoteIdentSugg {
823    #[suggestion_part(code = "\"")]
824    pub before: Span,
825    #[suggestion_part(code = "\"")]
826    pub after: Span,
827}
828
829#[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)]
830#[multipart_suggestion(attr_parsing_remove_neg_sugg, applicability = "machine-applicable")]
831pub(crate) struct InvalidMetaItemRemoveNegSugg {
832    #[suggestion_part(code = "")]
833    pub negative_sign: Span,
834}
835
836#[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)]
837#[diag(attr_parsing_suffixed_literal_in_attribute)]
838#[help]
839pub(crate) struct SuffixedLiteralInAttribute {
840    #[primary_span]
841    pub span: Span,
842}
843
844#[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)]
845#[diag(attr_parsing_empty_link_name, code = E0454)]
846pub(crate) struct EmptyLinkName {
847    #[primary_span]
848    #[label]
849    pub span: Span,
850}
851
852#[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)]
853#[diag(attr_parsing_link_framework_apple, code = E0455)]
854pub(crate) struct LinkFrameworkApple {
855    #[primary_span]
856    pub span: Span,
857}
858
859#[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)]
860#[diag(attr_parsing_incompatible_wasm_link)]
861pub(crate) struct IncompatibleWasmLink {
862    #[primary_span]
863    pub span: Span,
864}
865
866#[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)]
867#[diag(attr_parsing_link_requires_name, code = E0459)]
868pub(crate) struct LinkRequiresName {
869    #[primary_span]
870    #[label]
871    pub span: Span,
872}
873
874#[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)]
875#[diag(attr_parsing_raw_dylib_no_nul)]
876pub(crate) struct RawDylibNoNul {
877    #[primary_span]
878    pub span: Span,
879}
880
881#[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)]
882#[diag(attr_parsing_raw_dylib_only_windows, code = E0455)]
883pub(crate) struct RawDylibOnlyWindows {
884    #[primary_span]
885    pub span: Span,
886}
887
888#[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)]
889#[diag(attr_parsing_invalid_link_modifier)]
890pub(crate) struct InvalidLinkModifier {
891    #[primary_span]
892    pub span: Span,
893}
894
895#[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)]
896#[diag(attr_parsing_multiple_modifiers)]
897pub(crate) struct MultipleModifiers {
898    #[primary_span]
899    pub span: Span,
900    pub modifier: Symbol,
901}
902
903#[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)]
904#[diag(attr_parsing_import_name_type_x86)]
905pub(crate) struct ImportNameTypeX86 {
906    #[primary_span]
907    pub span: Span,
908}
909
910#[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)]
911#[diag(attr_parsing_bundle_needs_static)]
912pub(crate) struct BundleNeedsStatic {
913    #[primary_span]
914    pub span: Span,
915}
916
917#[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)]
918#[diag(attr_parsing_whole_archive_needs_static)]
919pub(crate) struct WholeArchiveNeedsStatic {
920    #[primary_span]
921    pub span: Span,
922}
923
924#[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)]
925#[diag(attr_parsing_as_needed_compatibility)]
926pub(crate) struct AsNeededCompatibility {
927    #[primary_span]
928    pub span: Span,
929}
930
931#[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)]
932#[diag(attr_parsing_import_name_type_raw)]
933pub(crate) struct ImportNameTypeRaw {
934    #[primary_span]
935    pub span: Span,
936}
937
938#[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)]
939#[diag(attr_parsing_limit_invalid)]
940pub(crate) struct LimitInvalid<'a> {
941    #[primary_span]
942    pub span: Span,
943    #[label]
944    pub value_span: Span,
945    pub error_str: &'a str,
946}
947
948#[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)]
949#[diag(attr_parsing_cfg_attr_bad_delim)]
950pub(crate) struct CfgAttrBadDelim {
951    #[primary_span]
952    pub span: Span,
953    #[subdiagnostic]
954    pub sugg: MetaBadDelimSugg,
955}
956
957#[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)]
958#[diag(attr_parsing_doc_alias_malformed)]
959pub(crate) struct DocAliasMalformed {
960    #[primary_span]
961    pub span: Span,
962}
963
964#[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)]
965#[diag(attr_parsing_unsupported_instruction_set)]
966pub(crate) struct UnsupportedInstructionSet<'a> {
967    #[primary_span]
968    pub span: Span,
969    pub instruction_set: Symbol,
970    pub current_target: &'a TargetTuple,
971}