Skip to main content

rustc_expand/
errors.rs

1use std::borrow::Cow;
2
3use rustc_ast::ast;
4use rustc_errors::codes::*;
5use rustc_hir::limit::Limit;
6use rustc_macros::{Diagnostic, LintDiagnostic, Subdiagnostic};
7use rustc_span::{Ident, MacroRulesNormalizedIdent, Span, Symbol};
8
9#[derive(const _: () =
    {
        impl<'__a> rustc_errors::LintDiagnostic<'__a, ()> for
            CfgAttrNoAttributes {
            #[track_caller]
            fn decorate_lint<'__b>(self,
                diag: &'__b mut rustc_errors::Diag<'__a, ()>) {
                match self {
                    CfgAttrNoAttributes => {
                        diag.primary_message(crate::fluent_generated::expand_cfg_attr_no_attributes);
                        ;
                        diag
                    }
                };
            }
        }
    };LintDiagnostic)]
10#[diag(expand_cfg_attr_no_attributes)]
11pub(crate) struct CfgAttrNoAttributes;
12
13#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            NoSyntaxVarsExprRepeat 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 {
                    NoSyntaxVarsExprRepeat { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::expand_expr_repeat_no_syntax_vars);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
14#[diag(expand_expr_repeat_no_syntax_vars)]
15pub(crate) struct NoSyntaxVarsExprRepeat {
16    #[primary_span]
17    pub span: Span,
18}
19
20#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for MustRepeatOnce
            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 {
                    MustRepeatOnce { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::expand_must_repeat_once);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
21#[diag(expand_must_repeat_once)]
22pub(crate) struct MustRepeatOnce {
23    #[primary_span]
24    pub span: Span,
25}
26
27#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            CountRepetitionMisplaced 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 {
                    CountRepetitionMisplaced { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::expand_count_repetition_misplaced);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
28#[diag(expand_count_repetition_misplaced)]
29pub(crate) struct CountRepetitionMisplaced {
30    #[primary_span]
31    pub span: Span,
32}
33
34#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            MacroVarStillRepeating 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 {
                    MacroVarStillRepeating {
                        span: __binding_0, ident: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::expand_metavar_still_repeating);
                        ;
                        diag.arg("ident", __binding_1);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
35#[diag(expand_metavar_still_repeating)]
36pub(crate) struct MacroVarStillRepeating {
37    #[primary_span]
38    pub span: Span,
39    pub ident: MacroRulesNormalizedIdent,
40}
41
42#[derive(const _: () =
    {
        impl<'__a> rustc_errors::LintDiagnostic<'__a, ()> for
            MetaVarStillRepeatingLint {
            #[track_caller]
            fn decorate_lint<'__b>(self,
                diag: &'__b mut rustc_errors::Diag<'__a, ()>) {
                match self {
                    MetaVarStillRepeatingLint {
                        label: __binding_0, ident: __binding_1 } => {
                        diag.primary_message(crate::fluent_generated::expand_metavar_still_repeating);
                        ;
                        diag.arg("ident", __binding_1);
                        diag.span_label(__binding_0,
                            crate::fluent_generated::_subdiag::label);
                        diag
                    }
                };
            }
        }
    };LintDiagnostic)]
43#[diag(expand_metavar_still_repeating)]
44pub(crate) struct MetaVarStillRepeatingLint {
45    #[label]
46    pub label: Span,
47    pub ident: MacroRulesNormalizedIdent,
48}
49
50#[derive(const _: () =
    {
        impl<'__a> rustc_errors::LintDiagnostic<'__a, ()> for
            MetaVariableWrongOperator {
            #[track_caller]
            fn decorate_lint<'__b>(self,
                diag: &'__b mut rustc_errors::Diag<'__a, ()>) {
                match self {
                    MetaVariableWrongOperator {
                        binder: __binding_0, occurrence: __binding_1 } => {
                        diag.primary_message(crate::fluent_generated::expand_metavariable_wrong_operator);
                        ;
                        diag.span_label(__binding_0,
                            crate::fluent_generated::expand_binder_label);
                        diag.span_label(__binding_1,
                            crate::fluent_generated::expand_occurrence_label);
                        diag
                    }
                };
            }
        }
    };LintDiagnostic)]
51#[diag(expand_metavariable_wrong_operator)]
52pub(crate) struct MetaVariableWrongOperator {
53    #[label(expand_binder_label)]
54    pub binder: Span,
55    #[label(expand_occurrence_label)]
56    pub occurrence: Span,
57}
58
59#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            MetaVarsDifSeqMatchers 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 {
                    MetaVarsDifSeqMatchers { span: __binding_0, msg: __binding_1
                        } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::expand_meta_var_dif_seq_matchers);
                        ;
                        diag.arg("msg", __binding_1);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
60#[diag(expand_meta_var_dif_seq_matchers)]
61pub(crate) struct MetaVarsDifSeqMatchers {
62    #[primary_span]
63    pub span: Span,
64    pub msg: String,
65}
66
67#[derive(const _: () =
    {
        impl<'__a> rustc_errors::LintDiagnostic<'__a, ()> for
            UnknownMacroVariable {
            #[track_caller]
            fn decorate_lint<'__b>(self,
                diag: &'__b mut rustc_errors::Diag<'__a, ()>) {
                match self {
                    UnknownMacroVariable { name: __binding_0 } => {
                        diag.primary_message(crate::fluent_generated::expand_unknown_macro_variable);
                        ;
                        diag.arg("name", __binding_0);
                        diag
                    }
                };
            }
        }
    };LintDiagnostic)]
68#[diag(expand_unknown_macro_variable)]
69pub(crate) struct UnknownMacroVariable {
70    pub name: MacroRulesNormalizedIdent,
71}
72
73#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            ResolveRelativePath 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 {
                    ResolveRelativePath { span: __binding_0, path: __binding_1 }
                        => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::expand_resolve_relative_path);
                        ;
                        diag.arg("path", __binding_1);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
74#[diag(expand_resolve_relative_path)]
75pub(crate) struct ResolveRelativePath {
76    #[primary_span]
77    pub span: Span,
78    pub path: String,
79}
80
81#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            MacroConstStability 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 {
                    MacroConstStability {
                        span: __binding_0, head_span: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::expand_macro_const_stability);
                        ;
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            crate::fluent_generated::_subdiag::label);
                        diag.span_label(__binding_1,
                            crate::fluent_generated::expand_label2);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
82#[diag(expand_macro_const_stability)]
83pub(crate) struct MacroConstStability {
84    #[primary_span]
85    #[label]
86    pub span: Span,
87    #[label(expand_label2)]
88    pub head_span: Span,
89}
90
91#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            MacroBodyStability 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 {
                    MacroBodyStability {
                        span: __binding_0, head_span: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::expand_macro_body_stability);
                        ;
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            crate::fluent_generated::_subdiag::label);
                        diag.span_label(__binding_1,
                            crate::fluent_generated::expand_label2);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
92#[diag(expand_macro_body_stability)]
93pub(crate) struct MacroBodyStability {
94    #[primary_span]
95    #[label]
96    pub span: Span,
97    #[label(expand_label2)]
98    pub head_span: Span,
99}
100
101#[derive(const _: () =
    {
        impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
            FeatureRemoved<'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 {
                    FeatureRemoved {
                        span: __binding_0,
                        reason: __binding_1,
                        removed_rustc_version: __binding_2,
                        pull_note: __binding_3 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::expand_feature_removed);
                        diag.code(E0557);
                        diag.note(crate::fluent_generated::_subdiag::note);
                        ;
                        diag.arg("removed_rustc_version", __binding_2);
                        diag.arg("pull_note", __binding_3);
                        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)]
102#[diag(expand_feature_removed, code = E0557)]
103#[note]
104pub(crate) struct FeatureRemoved<'a> {
105    #[primary_span]
106    #[label]
107    pub span: Span,
108    #[subdiagnostic]
109    pub reason: Option<FeatureRemovedReason<'a>>,
110    pub removed_rustc_version: &'a str,
111    pub pull_note: String,
112}
113
114#[derive(const _: () =
    {
        impl<'a> rustc_errors::Subdiagnostic for FeatureRemovedReason<'a> {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    FeatureRemovedReason { reason: __binding_0 } => {
                        diag.store_args();
                        diag.arg("reason", __binding_0);
                        let __message =
                            diag.eagerly_translate(crate::fluent_generated::expand_reason);
                        diag.note(__message);
                        diag.restore_args();
                    }
                }
            }
        }
    };Subdiagnostic)]
115#[note(expand_reason)]
116pub(crate) struct FeatureRemovedReason<'a> {
117    pub reason: &'a str,
118}
119
120#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            FeatureNotAllowed 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 {
                    FeatureNotAllowed { span: __binding_0, name: __binding_1 }
                        => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::expand_feature_not_allowed);
                        diag.code(E0725);
                        ;
                        diag.arg("name", __binding_1);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
121#[diag(expand_feature_not_allowed, code = E0725)]
122pub(crate) struct FeatureNotAllowed {
123    #[primary_span]
124    pub span: Span,
125    pub name: Symbol,
126}
127
128#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            RecursionLimitReached 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 {
                    RecursionLimitReached {
                        span: __binding_0,
                        descr: __binding_1,
                        suggested_limit: __binding_2,
                        crate_name: __binding_3 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::expand_recursion_limit_reached);
                        diag.help(crate::fluent_generated::_subdiag::help);
                        ;
                        diag.arg("descr", __binding_1);
                        diag.arg("suggested_limit", __binding_2);
                        diag.arg("crate_name", __binding_3);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
129#[diag(expand_recursion_limit_reached)]
130#[help]
131pub(crate) struct RecursionLimitReached {
132    #[primary_span]
133    pub span: Span,
134    pub descr: String,
135    pub suggested_limit: Limit,
136    pub crate_name: Symbol,
137}
138
139#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            MalformedFeatureAttribute 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 {
                    MalformedFeatureAttribute {
                        span: __binding_0, help: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::expand_malformed_feature_attribute);
                        diag.code(E0556);
                        ;
                        diag.span(__binding_0);
                        diag.subdiagnostic(__binding_1);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
140#[diag(expand_malformed_feature_attribute, code = E0556)]
141pub(crate) struct MalformedFeatureAttribute {
142    #[primary_span]
143    pub span: Span,
144    #[subdiagnostic]
145    pub help: MalformedFeatureAttributeHelp,
146}
147
148#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for MalformedFeatureAttributeHelp {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    MalformedFeatureAttributeHelp::Label { span: __binding_0 }
                        => {
                        diag.store_args();
                        let __message =
                            diag.eagerly_translate(crate::fluent_generated::expand_expected);
                        diag.span_label(__binding_0, __message);
                        diag.restore_args();
                    }
                    MalformedFeatureAttributeHelp::Suggestion {
                        span: __binding_0, suggestion: __binding_1 } => {
                        let __code_0 =
                            [::alloc::__export::must_use({
                                                ::alloc::fmt::format(format_args!("{0}", __binding_1))
                                            })].into_iter();
                        diag.store_args();
                        diag.arg("suggestion", __binding_1);
                        let __message =
                            diag.eagerly_translate(crate::fluent_generated::expand_expected);
                        diag.span_suggestions_with_style(__binding_0, __message,
                            __code_0, rustc_errors::Applicability::MaybeIncorrect,
                            rustc_errors::SuggestionStyle::ShowCode);
                        diag.restore_args();
                    }
                }
            }
        }
    };Subdiagnostic)]
149pub(crate) enum MalformedFeatureAttributeHelp {
150    #[label(expand_expected)]
151    Label {
152        #[primary_span]
153        span: Span,
154    },
155    #[suggestion(expand_expected, code = "{suggestion}", applicability = "maybe-incorrect")]
156    Suggestion {
157        #[primary_span]
158        span: Span,
159        suggestion: Symbol,
160    },
161}
162
163#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            RemoveExprNotSupported 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 {
                    RemoveExprNotSupported { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::expand_remove_expr_not_supported);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
164#[diag(expand_remove_expr_not_supported)]
165pub(crate) struct RemoveExprNotSupported {
166    #[primary_span]
167    pub span: Span,
168}
169
170#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for InvalidCfg
            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 {
                    InvalidCfg::NotFollowedByParens { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::expand_invalid_cfg_no_parens);
                        let __code_1 =
                            [::alloc::__export::must_use({
                                                ::alloc::fmt::format(format_args!("cfg(/* predicate */)"))
                                            })].into_iter();
                        ;
                        diag.span(__binding_0);
                        diag.span_suggestions_with_style(__binding_0,
                            crate::fluent_generated::expand_invalid_cfg_expected_syntax,
                            __code_1, rustc_errors::Applicability::HasPlaceholders,
                            rustc_errors::SuggestionStyle::ShowCode);
                        diag
                    }
                    InvalidCfg::NoPredicate { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::expand_invalid_cfg_no_predicate);
                        let __code_2 =
                            [::alloc::__export::must_use({
                                                ::alloc::fmt::format(format_args!("cfg(/* predicate */)"))
                                            })].into_iter();
                        ;
                        diag.span(__binding_0);
                        diag.span_suggestions_with_style(__binding_0,
                            crate::fluent_generated::expand_invalid_cfg_expected_syntax,
                            __code_2, rustc_errors::Applicability::HasPlaceholders,
                            rustc_errors::SuggestionStyle::ShowCode);
                        diag
                    }
                    InvalidCfg::MultiplePredicates { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::expand_invalid_cfg_multiple_predicates);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                    InvalidCfg::PredicateLiteral { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::expand_invalid_cfg_predicate_literal);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
171pub(crate) enum InvalidCfg {
172    #[diag(expand_invalid_cfg_no_parens)]
173    NotFollowedByParens {
174        #[primary_span]
175        #[suggestion(
176            expand_invalid_cfg_expected_syntax,
177            code = "cfg(/* predicate */)",
178            applicability = "has-placeholders"
179        )]
180        span: Span,
181    },
182    #[diag(expand_invalid_cfg_no_predicate)]
183    NoPredicate {
184        #[primary_span]
185        #[suggestion(
186            expand_invalid_cfg_expected_syntax,
187            code = "cfg(/* predicate */)",
188            applicability = "has-placeholders"
189        )]
190        span: Span,
191    },
192    #[diag(expand_invalid_cfg_multiple_predicates)]
193    MultiplePredicates {
194        #[primary_span]
195        span: Span,
196    },
197    #[diag(expand_invalid_cfg_predicate_literal)]
198    PredicateLiteral {
199        #[primary_span]
200        span: Span,
201    },
202}
203
204#[derive(const _: () =
    {
        impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
            WrongFragmentKind<'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 {
                    WrongFragmentKind {
                        span: __binding_0, kind: __binding_1, name: __binding_2 } =>
                        {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::expand_wrong_fragment_kind);
                        ;
                        diag.arg("kind", __binding_1);
                        diag.arg("name", __binding_2);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
205#[diag(expand_wrong_fragment_kind)]
206pub(crate) struct WrongFragmentKind<'a> {
207    #[primary_span]
208    pub span: Span,
209    pub kind: &'a str,
210    pub name: &'a ast::Path,
211}
212
213#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            UnsupportedKeyValue 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 {
                    UnsupportedKeyValue { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::expand_unsupported_key_value);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
214#[diag(expand_unsupported_key_value)]
215pub(crate) struct UnsupportedKeyValue {
216    #[primary_span]
217    pub span: Span,
218}
219
220#[derive(const _: () =
    {
        impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
            IncompleteParse<'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 {
                    IncompleteParse {
                        span: __binding_0,
                        descr: __binding_1,
                        label_span: __binding_2,
                        macro_path: __binding_3,
                        kind_name: __binding_4,
                        expands_to_match_arm: __binding_5,
                        add_semicolon: __binding_6 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::expand_incomplete_parse);
                        let __code_3 =
                            [::alloc::__export::must_use({
                                                ::alloc::fmt::format(format_args!(";"))
                                            })].into_iter();
                        diag.note(crate::fluent_generated::_subdiag::note);
                        ;
                        diag.arg("descr", __binding_1);
                        diag.arg("macro_path", __binding_3);
                        diag.arg("kind_name", __binding_4);
                        diag.span(__binding_0);
                        diag.span_label(__binding_2,
                            crate::fluent_generated::_subdiag::label);
                        if __binding_5 {
                            diag.note(crate::fluent_generated::expand_macro_expands_to_match_arm);
                        }
                        if let Some(__binding_6) = __binding_6 {
                            diag.span_suggestions_with_style(__binding_6,
                                crate::fluent_generated::expand_suggestion_add_semi,
                                __code_3, rustc_errors::Applicability::MaybeIncorrect,
                                rustc_errors::SuggestionStyle::ShowAlways);
                        }
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
221#[diag(expand_incomplete_parse)]
222#[note]
223pub(crate) struct IncompleteParse<'a> {
224    #[primary_span]
225    pub span: Span,
226    pub descr: String,
227    #[label]
228    pub label_span: Span,
229    pub macro_path: &'a ast::Path,
230    pub kind_name: &'a str,
231    #[note(expand_macro_expands_to_match_arm)]
232    pub expands_to_match_arm: bool,
233
234    #[suggestion(
235        expand_suggestion_add_semi,
236        style = "verbose",
237        code = ";",
238        applicability = "maybe-incorrect"
239    )]
240    pub add_semicolon: Option<Span>,
241}
242
243#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            RemoveNodeNotSupported 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 {
                    RemoveNodeNotSupported {
                        span: __binding_0, descr: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::expand_remove_node_not_supported);
                        ;
                        diag.arg("descr", __binding_1);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
244#[diag(expand_remove_node_not_supported)]
245pub(crate) struct RemoveNodeNotSupported {
246    #[primary_span]
247    pub span: Span,
248    pub descr: &'static str,
249}
250
251#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for ModuleCircular
            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 {
                    ModuleCircular { span: __binding_0, modules: __binding_1 }
                        => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::expand_module_circular);
                        ;
                        diag.arg("modules", __binding_1);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
252#[diag(expand_module_circular)]
253pub(crate) struct ModuleCircular {
254    #[primary_span]
255    pub span: Span,
256    pub modules: String,
257}
258
259#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for ModuleInBlock
            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 {
                    ModuleInBlock { span: __binding_0, name: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::expand_module_in_block);
                        diag.note(crate::fluent_generated::_subdiag::note);
                        ;
                        diag.span(__binding_0);
                        if let Some(__binding_1) = __binding_1 {
                            diag.subdiagnostic(__binding_1);
                        }
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
260#[diag(expand_module_in_block)]
261#[note]
262pub(crate) struct ModuleInBlock {
263    #[primary_span]
264    pub span: Span,
265    #[subdiagnostic]
266    pub name: Option<ModuleInBlockName>,
267}
268
269#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for ModuleInBlockName {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    ModuleInBlockName { span: __binding_0, name: __binding_1 }
                        => {
                        diag.store_args();
                        diag.arg("name", __binding_1);
                        let __message =
                            diag.eagerly_translate(crate::fluent_generated::expand_help);
                        diag.span_help(__binding_0, __message);
                        diag.restore_args();
                    }
                }
            }
        }
    };Subdiagnostic)]
270#[help(expand_help)]
271pub(crate) struct ModuleInBlockName {
272    #[primary_span]
273    pub span: Span,
274    pub name: Ident,
275}
276
277#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            ModuleFileNotFound 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 {
                    ModuleFileNotFound {
                        span: __binding_0,
                        name: __binding_1,
                        default_path: __binding_2,
                        secondary_path: __binding_3 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::expand_module_file_not_found);
                        diag.code(E0583);
                        diag.help(crate::fluent_generated::_subdiag::help);
                        diag.note(crate::fluent_generated::_subdiag::note);
                        ;
                        diag.arg("name", __binding_1);
                        diag.arg("default_path", __binding_2);
                        diag.arg("secondary_path", __binding_3);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
278#[diag(expand_module_file_not_found, code = E0583)]
279#[help]
280#[note]
281pub(crate) struct ModuleFileNotFound {
282    #[primary_span]
283    pub span: Span,
284    pub name: Ident,
285    pub default_path: String,
286    pub secondary_path: String,
287}
288
289#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            ModuleMultipleCandidates 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 {
                    ModuleMultipleCandidates {
                        span: __binding_0,
                        name: __binding_1,
                        default_path: __binding_2,
                        secondary_path: __binding_3 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::expand_module_multiple_candidates);
                        diag.code(E0761);
                        diag.help(crate::fluent_generated::_subdiag::help);
                        ;
                        diag.arg("name", __binding_1);
                        diag.arg("default_path", __binding_2);
                        diag.arg("secondary_path", __binding_3);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
290#[diag(expand_module_multiple_candidates, code = E0761)]
291#[help]
292pub(crate) struct ModuleMultipleCandidates {
293    #[primary_span]
294    pub span: Span,
295    pub name: Ident,
296    pub default_path: String,
297    pub secondary_path: String,
298}
299
300#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for TraceMacro
            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 {
                    TraceMacro { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::expand_trace_macro);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
301#[diag(expand_trace_macro)]
302pub(crate) struct TraceMacro {
303    #[primary_span]
304    pub span: Span,
305}
306
307#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            ProcMacroPanicked 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 {
                    ProcMacroPanicked { span: __binding_0, message: __binding_1
                        } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::expand_proc_macro_panicked);
                        ;
                        diag.span(__binding_0);
                        if let Some(__binding_1) = __binding_1 {
                            diag.subdiagnostic(__binding_1);
                        }
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
308#[diag(expand_proc_macro_panicked)]
309pub(crate) struct ProcMacroPanicked {
310    #[primary_span]
311    pub span: Span,
312    #[subdiagnostic]
313    pub message: Option<ProcMacroPanickedHelp>,
314}
315
316#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for ProcMacroPanickedHelp {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    ProcMacroPanickedHelp { message: __binding_0 } => {
                        diag.store_args();
                        diag.arg("message", __binding_0);
                        let __message =
                            diag.eagerly_translate(crate::fluent_generated::expand_help);
                        diag.help(__message);
                        diag.restore_args();
                    }
                }
            }
        }
    };Subdiagnostic)]
317#[help(expand_help)]
318pub(crate) struct ProcMacroPanickedHelp {
319    pub message: String,
320}
321
322#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            ProcMacroDerivePanicked 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 {
                    ProcMacroDerivePanicked {
                        span: __binding_0, message: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::expand_proc_macro_derive_panicked);
                        ;
                        diag.span(__binding_0);
                        if let Some(__binding_1) = __binding_1 {
                            diag.subdiagnostic(__binding_1);
                        }
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
323#[diag(expand_proc_macro_derive_panicked)]
324pub(crate) struct ProcMacroDerivePanicked {
325    #[primary_span]
326    pub span: Span,
327    #[subdiagnostic]
328    pub message: Option<ProcMacroDerivePanickedHelp>,
329}
330
331#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for ProcMacroDerivePanickedHelp {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    ProcMacroDerivePanickedHelp { message: __binding_0 } => {
                        diag.store_args();
                        diag.arg("message", __binding_0);
                        let __message =
                            diag.eagerly_translate(crate::fluent_generated::expand_help);
                        diag.help(__message);
                        diag.restore_args();
                    }
                }
            }
        }
    };Subdiagnostic)]
332#[help(expand_help)]
333pub(crate) struct ProcMacroDerivePanickedHelp {
334    pub message: String,
335}
336
337#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            CustomAttributePanicked 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 {
                    CustomAttributePanicked {
                        span: __binding_0, message: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::expand_custom_attribute_panicked);
                        ;
                        diag.span(__binding_0);
                        if let Some(__binding_1) = __binding_1 {
                            diag.subdiagnostic(__binding_1);
                        }
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
338#[diag(expand_custom_attribute_panicked)]
339pub(crate) struct CustomAttributePanicked {
340    #[primary_span]
341    pub span: Span,
342    #[subdiagnostic]
343    pub message: Option<CustomAttributePanickedHelp>,
344}
345
346#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for CustomAttributePanickedHelp {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    CustomAttributePanickedHelp { message: __binding_0 } => {
                        diag.store_args();
                        diag.arg("message", __binding_0);
                        let __message =
                            diag.eagerly_translate(crate::fluent_generated::expand_help);
                        diag.help(__message);
                        diag.restore_args();
                    }
                }
            }
        }
    };Subdiagnostic)]
347#[help(expand_help)]
348pub(crate) struct CustomAttributePanickedHelp {
349    pub message: String,
350}
351
352#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            ProcMacroDeriveTokens 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 {
                    ProcMacroDeriveTokens { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::expand_proc_macro_derive_tokens);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
353#[diag(expand_proc_macro_derive_tokens)]
354pub(crate) struct ProcMacroDeriveTokens {
355    #[primary_span]
356    pub span: Span,
357}
358
359#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            DuplicateMatcherBinding 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 {
                    DuplicateMatcherBinding {
                        span: __binding_0, prev: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::expand_duplicate_matcher_binding);
                        ;
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            crate::fluent_generated::_subdiag::label);
                        diag.span_label(__binding_1,
                            crate::fluent_generated::expand_label2);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
360#[diag(expand_duplicate_matcher_binding)]
361pub(crate) struct DuplicateMatcherBinding {
362    #[primary_span]
363    #[label]
364    pub span: Span,
365    #[label(expand_label2)]
366    pub prev: Span,
367}
368
369#[derive(const _: () =
    {
        impl<'__a> rustc_errors::LintDiagnostic<'__a, ()> for
            DuplicateMatcherBindingLint {
            #[track_caller]
            fn decorate_lint<'__b>(self,
                diag: &'__b mut rustc_errors::Diag<'__a, ()>) {
                match self {
                    DuplicateMatcherBindingLint {
                        span: __binding_0, prev: __binding_1 } => {
                        diag.primary_message(crate::fluent_generated::expand_duplicate_matcher_binding);
                        ;
                        diag.span_label(__binding_0,
                            crate::fluent_generated::_subdiag::label);
                        diag.span_label(__binding_1,
                            crate::fluent_generated::expand_label2);
                        diag
                    }
                };
            }
        }
    };LintDiagnostic)]
370#[diag(expand_duplicate_matcher_binding)]
371pub(crate) struct DuplicateMatcherBindingLint {
372    #[label]
373    pub span: Span,
374    #[label(expand_label2)]
375    pub prev: Span,
376}
377
378#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            MissingFragmentSpecifier 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 {
                    MissingFragmentSpecifier {
                        span: __binding_0, add_span: __binding_1, valid: __binding_2
                        } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::expand_missing_fragment_specifier);
                        let __code_4 =
                            [::alloc::__export::must_use({
                                                ::alloc::fmt::format(format_args!(":spec"))
                                            })].into_iter();
                        diag.note(crate::fluent_generated::_subdiag::note);
                        diag.help(crate::fluent_generated::expand_valid);
                        ;
                        diag.arg("valid", __binding_2);
                        diag.span(__binding_0);
                        diag.span_suggestions_with_style(__binding_1,
                            crate::fluent_generated::expand_suggestion_add_fragspec,
                            __code_4, rustc_errors::Applicability::MaybeIncorrect,
                            rustc_errors::SuggestionStyle::ShowAlways);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
379#[diag(expand_missing_fragment_specifier)]
380#[note]
381#[help(expand_valid)]
382pub(crate) struct MissingFragmentSpecifier {
383    #[primary_span]
384    pub span: Span,
385    #[suggestion(
386        expand_suggestion_add_fragspec,
387        style = "verbose",
388        code = ":spec",
389        applicability = "maybe-incorrect"
390    )]
391    pub add_span: Span,
392    pub valid: &'static str,
393}
394
395#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            InvalidFragmentSpecifier 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 {
                    InvalidFragmentSpecifier {
                        span: __binding_0, fragment: __binding_1, help: __binding_2
                        } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::expand_invalid_fragment_specifier);
                        diag.help(crate::fluent_generated::_subdiag::help);
                        ;
                        diag.arg("fragment", __binding_1);
                        diag.arg("help", __binding_2);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
396#[diag(expand_invalid_fragment_specifier)]
397#[help]
398pub(crate) struct InvalidFragmentSpecifier {
399    #[primary_span]
400    pub span: Span,
401    pub fragment: Ident,
402    pub help: &'static str,
403}
404
405#[derive(const _: () =
    {
        impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
            ExpectedParenOrBrace<'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 {
                    ExpectedParenOrBrace { span: __binding_0, token: __binding_1
                        } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::expand_expected_paren_or_brace);
                        ;
                        diag.arg("token", __binding_1);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
406#[diag(expand_expected_paren_or_brace)]
407pub(crate) struct ExpectedParenOrBrace<'a> {
408    #[primary_span]
409    pub span: Span,
410    pub token: Cow<'a, str>,
411}
412
413#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            EmptyDelegationMac 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 {
                    EmptyDelegationMac { span: __binding_0, kind: __binding_1 }
                        => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::expand_empty_delegation_mac);
                        ;
                        diag.arg("kind", __binding_1);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
414#[diag(expand_empty_delegation_mac)]
415pub(crate) struct EmptyDelegationMac {
416    #[primary_span]
417    pub span: Span,
418    pub kind: String,
419}
420
421#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            GlobDelegationOutsideImpls 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 {
                    GlobDelegationOutsideImpls { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::expand_glob_delegation_outside_impls);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
422#[diag(expand_glob_delegation_outside_impls)]
423pub(crate) struct GlobDelegationOutsideImpls {
424    #[primary_span]
425    pub span: Span,
426}
427
428#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            CrateNameInCfgAttr 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 {
                    CrateNameInCfgAttr { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::expand_crate_name_in_cfg_attr);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
429#[diag(expand_crate_name_in_cfg_attr)]
430pub(crate) struct CrateNameInCfgAttr {
431    #[primary_span]
432    pub span: Span,
433}
434
435#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            CrateTypeInCfgAttr 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 {
                    CrateTypeInCfgAttr { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::expand_crate_type_in_cfg_attr);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
436#[diag(expand_crate_type_in_cfg_attr)]
437pub(crate) struct CrateTypeInCfgAttr {
438    #[primary_span]
439    pub span: Span,
440}
441
442#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            GlobDelegationTraitlessQpath 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 {
                    GlobDelegationTraitlessQpath { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::expand_glob_delegation_traitless_qpath);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
443#[diag(expand_glob_delegation_traitless_qpath)]
444pub(crate) struct GlobDelegationTraitlessQpath {
445    #[primary_span]
446    pub span: Span,
447}
448
449// This used to be the `proc_macro_back_compat` lint (#83125). It was later
450// turned into a hard error.
451#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            ProcMacroBackCompat 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 {
                    ProcMacroBackCompat {
                        crate_name: __binding_0, fixed_version: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::expand_proc_macro_back_compat);
                        diag.note(crate::fluent_generated::_subdiag::note);
                        ;
                        diag.arg("crate_name", __binding_0);
                        diag.arg("fixed_version", __binding_1);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
452#[diag(expand_proc_macro_back_compat)]
453#[note]
454pub(crate) struct ProcMacroBackCompat {
455    pub crate_name: String,
456    pub fixed_version: String,
457}
458
459pub(crate) use metavar_exprs::*;
460mod metavar_exprs {
461    use super::*;
462
463    #[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for MveExtraTokens
            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 {
                    MveExtraTokens {
                        span: __binding_0,
                        ident_span: __binding_1,
                        extra_count: __binding_2,
                        exact_args_note: __binding_3,
                        range_args_note: __binding_4,
                        min_or_exact_args: __binding_5,
                        max_args: __binding_6,
                        name: __binding_7 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::expand_mve_extra_tokens);
                        let __code_5 =
                            [::alloc::__export::must_use({
                                                ::alloc::fmt::format(format_args!(""))
                                            })].into_iter();
                        ;
                        diag.arg("extra_count", __binding_2);
                        diag.arg("min_or_exact_args", __binding_5);
                        diag.arg("max_args", __binding_6);
                        diag.arg("name", __binding_7);
                        diag.span(__binding_0);
                        diag.span_suggestions_with_style(__binding_0,
                            crate::fluent_generated::_subdiag::suggestion, __code_5,
                            rustc_errors::Applicability::MachineApplicable,
                            rustc_errors::SuggestionStyle::ShowCode);
                        diag.span_label(__binding_1,
                            crate::fluent_generated::_subdiag::label);
                        if let Some(__binding_3) = __binding_3 {
                            diag.note(crate::fluent_generated::expand_exact);
                        }
                        if let Some(__binding_4) = __binding_4 {
                            diag.note(crate::fluent_generated::expand_range);
                        }
                        diag
                    }
                }
            }
        }
    };Diagnostic, #[automatically_derived]
impl ::core::default::Default for MveExtraTokens {
    #[inline]
    fn default() -> MveExtraTokens {
        MveExtraTokens {
            span: ::core::default::Default::default(),
            ident_span: ::core::default::Default::default(),
            extra_count: ::core::default::Default::default(),
            exact_args_note: ::core::default::Default::default(),
            range_args_note: ::core::default::Default::default(),
            min_or_exact_args: ::core::default::Default::default(),
            max_args: ::core::default::Default::default(),
            name: ::core::default::Default::default(),
        }
    }
}Default)]
464    #[diag(expand_mve_extra_tokens)]
465    pub(crate) struct MveExtraTokens {
466        #[primary_span]
467        #[suggestion(code = "", applicability = "machine-applicable")]
468        pub span: Span,
469        #[label]
470        pub ident_span: Span,
471        pub extra_count: usize,
472
473        // The rest is only used for specific diagnostics and can be default if neither
474        // `note` is `Some`.
475        #[note(expand_exact)]
476        pub exact_args_note: Option<()>,
477        #[note(expand_range)]
478        pub range_args_note: Option<()>,
479        pub min_or_exact_args: usize,
480        pub max_args: usize,
481        pub name: String,
482    }
483
484    #[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            MveMissingParen 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 {
                    MveMissingParen {
                        ident_span: __binding_0,
                        unexpected_span: __binding_1,
                        insert_span: __binding_2 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::expand_mve_missing_paren);
                        let __code_6 =
                            [::alloc::__export::must_use({
                                                ::alloc::fmt::format(format_args!("( /* ... */ )"))
                                            })].into_iter();
                        diag.note(crate::fluent_generated::_subdiag::note);
                        ;
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            crate::fluent_generated::_subdiag::label);
                        if let Some(__binding_1) = __binding_1 {
                            diag.span_label(__binding_1,
                                crate::fluent_generated::expand_unexpected);
                        }
                        if let Some(__binding_2) = __binding_2 {
                            diag.span_suggestions_with_style(__binding_2,
                                crate::fluent_generated::_subdiag::suggestion, __code_6,
                                rustc_errors::Applicability::HasPlaceholders,
                                rustc_errors::SuggestionStyle::ShowCode);
                        }
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
485    #[note]
486    #[diag(expand_mve_missing_paren)]
487    pub(crate) struct MveMissingParen {
488        #[primary_span]
489        #[label]
490        pub ident_span: Span,
491        #[label(expand_unexpected)]
492        pub unexpected_span: Option<Span>,
493        #[suggestion(code = "( /* ... */ )", applicability = "has-placeholders")]
494        pub insert_span: Option<Span>,
495    }
496
497    #[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            MveUnrecognizedExpr 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 {
                    MveUnrecognizedExpr {
                        span: __binding_0, valid_expr_list: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::expand_mve_unrecognized_expr);
                        diag.note(crate::fluent_generated::_subdiag::note);
                        ;
                        diag.arg("valid_expr_list", __binding_1);
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            crate::fluent_generated::_subdiag::label);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
498    #[note]
499    #[diag(expand_mve_unrecognized_expr)]
500    pub(crate) struct MveUnrecognizedExpr {
501        #[primary_span]
502        #[label]
503        pub span: Span,
504        pub valid_expr_list: &'static str,
505    }
506
507    #[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            MveUnrecognizedVar 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 {
                    MveUnrecognizedVar { span: __binding_0, key: __binding_1 }
                        => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::expand_mve_unrecognized_var);
                        ;
                        diag.arg("key", __binding_1);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
508    #[diag(expand_mve_unrecognized_var)]
509    pub(crate) struct MveUnrecognizedVar {
510        #[primary_span]
511        pub span: Span,
512        pub key: MacroRulesNormalizedIdent,
513    }
514}
515
516#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            MacroArgsBadDelim 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 {
                    MacroArgsBadDelim {
                        span: __binding_0, sugg: __binding_1, rule_kw: __binding_2 }
                        => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::expand_macro_args_bad_delim);
                        ;
                        diag.arg("rule_kw", __binding_2);
                        diag.span(__binding_0);
                        diag.subdiagnostic(__binding_1);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
517#[diag(expand_macro_args_bad_delim)]
518pub(crate) struct MacroArgsBadDelim {
519    #[primary_span]
520    pub span: Span,
521    #[subdiagnostic]
522    pub sugg: MacroArgsBadDelimSugg,
523    pub rule_kw: Symbol,
524}
525
526#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for MacroArgsBadDelimSugg {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    MacroArgsBadDelimSugg {
                        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::expand_macro_args_bad_delim_sugg);
                        diag.multipart_suggestion_with_style(__message, suggestions,
                            rustc_errors::Applicability::MachineApplicable,
                            rustc_errors::SuggestionStyle::ShowCode);
                        diag.restore_args();
                    }
                }
            }
        }
    };Subdiagnostic)]
527#[multipart_suggestion(expand_macro_args_bad_delim_sugg, applicability = "machine-applicable")]
528pub(crate) struct MacroArgsBadDelimSugg {
529    #[suggestion_part(code = "(")]
530    pub open: Span,
531    #[suggestion_part(code = ")")]
532    pub close: Span,
533}
534
535#[derive(const _: () =
    {
        impl<'__a> rustc_errors::LintDiagnostic<'__a, ()> for
            MacroCallUnusedDocComment {
            #[track_caller]
            fn decorate_lint<'__b>(self,
                diag: &'__b mut rustc_errors::Diag<'__a, ()>) {
                match self {
                    MacroCallUnusedDocComment { span: __binding_0 } => {
                        diag.primary_message(crate::fluent_generated::expand_macro_call_unused_doc_comment);
                        diag.help(crate::fluent_generated::_subdiag::help);
                        ;
                        diag.span_label(__binding_0,
                            crate::fluent_generated::_subdiag::label);
                        diag
                    }
                };
            }
        }
    };LintDiagnostic)]
536#[diag(expand_macro_call_unused_doc_comment)]
537#[help]
538pub(crate) struct MacroCallUnusedDocComment {
539    #[label]
540    pub span: Span,
541}
542
543#[derive(const _: () =
    {
        impl<'__a> rustc_errors::LintDiagnostic<'__a, ()> for
            OrPatternsBackCompat {
            #[track_caller]
            fn decorate_lint<'__b>(self,
                diag: &'__b mut rustc_errors::Diag<'__a, ()>) {
                match self {
                    OrPatternsBackCompat {
                        span: __binding_0, suggestion: __binding_1 } => {
                        diag.primary_message(crate::fluent_generated::expand_or_patterns_back_compat);
                        ;
                        let __code_9 =
                            [::alloc::__export::must_use({
                                                ::alloc::fmt::format(format_args!("{0}", __binding_1))
                                            })].into_iter();
                        diag.arg("suggestion", __binding_1);
                        diag.span_suggestions_with_style(__binding_0,
                            crate::fluent_generated::_subdiag::suggestion, __code_9,
                            rustc_errors::Applicability::MachineApplicable,
                            rustc_errors::SuggestionStyle::ShowCode);
                        diag
                    }
                };
            }
        }
    };LintDiagnostic)]
544#[diag(expand_or_patterns_back_compat)]
545pub(crate) struct OrPatternsBackCompat {
546    #[suggestion(code = "{suggestion}", applicability = "machine-applicable")]
547    pub span: Span,
548    pub suggestion: String,
549}
550
551#[derive(const _: () =
    {
        impl<'__a> rustc_errors::LintDiagnostic<'__a, ()> for TrailingMacro {
            #[track_caller]
            fn decorate_lint<'__b>(self,
                diag: &'__b mut rustc_errors::Diag<'__a, ()>) {
                match self {
                    TrailingMacro { is_trailing: __binding_0, name: __binding_1
                        } => {
                        diag.primary_message(crate::fluent_generated::expand_trailing_semi_macro);
                        ;
                        diag.arg("name", __binding_1);
                        if __binding_0 {
                            diag.note(crate::fluent_generated::expand_note1);
                        }
                        if __binding_0 {
                            diag.note(crate::fluent_generated::expand_note2);
                        }
                        diag
                    }
                };
            }
        }
    };LintDiagnostic)]
552#[diag(expand_trailing_semi_macro)]
553pub(crate) struct TrailingMacro {
554    #[note(expand_note1)]
555    #[note(expand_note2)]
556    pub is_trailing: bool,
557    pub name: Ident,
558}
559
560#[derive(const _: () =
    {
        impl<'__a> rustc_errors::LintDiagnostic<'__a, ()> for
            UnusedBuiltinAttribute {
            #[track_caller]
            fn decorate_lint<'__b>(self,
                diag: &'__b mut rustc_errors::Diag<'__a, ()>) {
                match self {
                    UnusedBuiltinAttribute {
                        invoc_span: __binding_0,
                        attr_name: __binding_1,
                        macro_name: __binding_2,
                        attr_span: __binding_3 } => {
                        diag.primary_message(crate::fluent_generated::expand_unused_builtin_attribute);
                        ;
                        let __code_10 =
                            [::alloc::__export::must_use({
                                                ::alloc::fmt::format(format_args!(""))
                                            })].into_iter();
                        diag.arg("attr_name", __binding_1);
                        diag.arg("macro_name", __binding_2);
                        diag.span_note(__binding_0,
                            crate::fluent_generated::_subdiag::note);
                        diag.span_suggestions_with_style(__binding_3,
                            crate::fluent_generated::_subdiag::suggestion, __code_10,
                            rustc_errors::Applicability::MachineApplicable,
                            rustc_errors::SuggestionStyle::CompletelyHidden);
                        diag
                    }
                };
            }
        }
    };LintDiagnostic)]
561#[diag(expand_unused_builtin_attribute)]
562pub(crate) struct UnusedBuiltinAttribute {
563    #[note]
564    pub invoc_span: Span,
565    pub attr_name: Symbol,
566    pub macro_name: String,
567    #[suggestion(code = "", applicability = "machine-applicable", style = "tool-only")]
568    pub attr_span: Span,
569}