Skip to main content

rustc_resolve/
errors.rs

1use rustc_errors::codes::*;
2use rustc_errors::formatting::DiagMessageAddArg;
3use rustc_errors::{
4    Applicability, Diag, DiagCtxtHandle, Diagnostic, ElidedLifetimeInPathSubdiag,
5    EmissionGuarantee, IntoDiagArg, Level, MultiSpan, Subdiagnostic, msg,
6};
7use rustc_macros::{Diagnostic, Subdiagnostic};
8use rustc_span::{Ident, Span, Spanned, Symbol};
9
10use crate::Res;
11use crate::late::PatternSource;
12
13#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            GenericParamsFromOuterItem 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 {
                    GenericParamsFromOuterItem {
                        span: __binding_0,
                        label: __binding_1,
                        refer_to_type_directly: __binding_2,
                        sugg: __binding_3,
                        static_or_const: __binding_4,
                        is_self: __binding_5,
                        item: __binding_6 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("can't use {$is_self ->\n        [true] `Self`\n        *[false] generic parameters\n    } from outer item")));
                        diag.code(E0401);
                        diag.note(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("nested items are independent from their parent item for everything except for privacy and name resolution")));
                        ;
                        diag.arg("is_self", __binding_5);
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("use of {$is_self ->\n            [true] `Self`\n            *[false] generic parameter\n        } from outer item")));
                        if let Some(__binding_1) = __binding_1 {
                            diag.subdiagnostic(__binding_1);
                        }
                        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.subdiagnostic(__binding_4);
                        }
                        if let Some(__binding_6) = __binding_6 {
                            diag.subdiagnostic(__binding_6);
                        }
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
14#[diag("can't use {$is_self ->
15        [true] `Self`
16        *[false] generic parameters
17    } from outer item", code = E0401)]
18#[note(
19    "nested items are independent from their parent item for everything except for privacy and name resolution"
20)]
21pub(crate) struct GenericParamsFromOuterItem {
22    #[primary_span]
23    #[label(
24        "use of {$is_self ->
25            [true] `Self`
26            *[false] generic parameter
27        } from outer item"
28    )]
29    pub(crate) span: Span,
30    #[subdiagnostic]
31    pub(crate) label: Option<GenericParamsFromOuterItemLabel>,
32    #[subdiagnostic]
33    pub(crate) refer_to_type_directly: Option<UseTypeDirectly>,
34    #[subdiagnostic]
35    pub(crate) sugg: Option<GenericParamsFromOuterItemSugg>,
36    #[subdiagnostic]
37    pub(crate) static_or_const: Option<GenericParamsFromOuterItemStaticOrConst>,
38    pub(crate) is_self: bool,
39    #[subdiagnostic]
40    pub(crate) item: Option<GenericParamsFromOuterItemInnerItem>,
41}
42
43#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for
            GenericParamsFromOuterItemInnerItem {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    GenericParamsFromOuterItemInnerItem {
                        span: __binding_0, descr: __binding_1, is_self: __binding_2
                        } => {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("descr".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_1,
                                &mut diag.long_ty_path));
                        sub_args.insert("is_self".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_2,
                                &mut diag.long_ty_path));
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("{$is_self ->\n        [true] `Self`\n        *[false] generic parameter\n    } used in this inner {$descr}")),
                                &sub_args);
                        diag.span_label(__binding_0, __message);
                    }
                }
            }
        }
    };Subdiagnostic)]
44#[label(
45    "{$is_self ->
46        [true] `Self`
47        *[false] generic parameter
48    } used in this inner {$descr}"
49)]
50pub(crate) struct GenericParamsFromOuterItemInnerItem {
51    #[primary_span]
52    pub(crate) span: Span,
53    pub(crate) descr: String,
54    pub(crate) is_self: bool,
55}
56
57#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for
            GenericParamsFromOuterItemStaticOrConst {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    GenericParamsFromOuterItemStaticOrConst::Static => {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("a `static` is a separate item from the item that contains it")),
                                &sub_args);
                        diag.note(__message);
                    }
                    GenericParamsFromOuterItemStaticOrConst::Const => {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("a `const` is a separate item from the item that contains it")),
                                &sub_args);
                        diag.note(__message);
                    }
                }
            }
        }
    };Subdiagnostic)]
58pub(crate) enum GenericParamsFromOuterItemStaticOrConst {
59    #[note("a `static` is a separate item from the item that contains it")]
60    Static,
61    #[note("a `const` is a separate item from the item that contains it")]
62    Const,
63}
64
65#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for GenericParamsFromOuterItemLabel {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    GenericParamsFromOuterItemLabel::SelfTyParam(__binding_0) =>
                        {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("can't use `Self` here")),
                                &sub_args);
                        diag.span_label(__binding_0, __message);
                    }
                    GenericParamsFromOuterItemLabel::SelfTyAlias(__binding_0) =>
                        {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`Self` type implicitly declared here, by this `impl`")),
                                &sub_args);
                        diag.span_label(__binding_0, __message);
                    }
                    GenericParamsFromOuterItemLabel::TyParam(__binding_0) => {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("type parameter from outer item")),
                                &sub_args);
                        diag.span_label(__binding_0, __message);
                    }
                    GenericParamsFromOuterItemLabel::ConstParam(__binding_0) =>
                        {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("const parameter from outer item")),
                                &sub_args);
                        diag.span_label(__binding_0, __message);
                    }
                }
            }
        }
    };Subdiagnostic)]
66pub(crate) enum GenericParamsFromOuterItemLabel {
67    #[label("can't use `Self` here")]
68    SelfTyParam(#[primary_span] Span),
69    #[label("`Self` type implicitly declared here, by this `impl`")]
70    SelfTyAlias(#[primary_span] Span),
71    #[label("type parameter from outer item")]
72    TyParam(#[primary_span] Span),
73    #[label("const parameter from outer item")]
74    ConstParam(#[primary_span] Span),
75}
76
77#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for GenericParamsFromOuterItemSugg {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    GenericParamsFromOuterItemSugg {
                        span: __binding_0, snippet: __binding_1 } => {
                        let __code_0 =
                            [::alloc::__export::must_use({
                                                ::alloc::fmt::format(format_args!("{0}", __binding_1))
                                            })].into_iter();
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("snippet".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_1,
                                &mut diag.long_ty_path));
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("try introducing a local generic parameter here")),
                                &sub_args);
                        diag.span_suggestions_with_style(__binding_0, __message,
                            __code_0, rustc_errors::Applicability::MaybeIncorrect,
                            rustc_errors::SuggestionStyle::ShowAlways);
                    }
                }
            }
        }
    };Subdiagnostic)]
78#[suggestion(
79    "try introducing a local generic parameter here",
80    code = "{snippet}",
81    applicability = "maybe-incorrect",
82    style = "verbose"
83)]
84pub(crate) struct GenericParamsFromOuterItemSugg {
85    #[primary_span]
86    pub(crate) span: Span,
87    pub(crate) snippet: String,
88}
89#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for UseTypeDirectly {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    UseTypeDirectly { span: __binding_0, snippet: __binding_1 }
                        => {
                        let __code_1 =
                            [::alloc::__export::must_use({
                                                ::alloc::fmt::format(format_args!("{0}", __binding_1))
                                            })].into_iter();
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("snippet".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_1,
                                &mut diag.long_ty_path));
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("refer to the type directly here instead")),
                                &sub_args);
                        diag.span_suggestions_with_style(__binding_0, __message,
                            __code_1, rustc_errors::Applicability::MaybeIncorrect,
                            rustc_errors::SuggestionStyle::ShowAlways);
                    }
                }
            }
        }
    };Subdiagnostic)]
90#[suggestion(
91    "refer to the type directly here instead",
92    code = "{snippet}",
93    applicability = "maybe-incorrect",
94    style = "verbose"
95)]
96pub(crate) struct UseTypeDirectly {
97    #[primary_span]
98    pub(crate) span: Span,
99    pub(crate) snippet: String,
100}
101
102#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            NameAlreadyUsedInParameterList 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 {
                    NameAlreadyUsedInParameterList {
                        span: __binding_0,
                        first_use_span: __binding_1,
                        name: __binding_2 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the name `{$name}` is already used for a generic parameter in this item's generic parameters")));
                        diag.code(E0403);
                        ;
                        diag.arg("name", __binding_2);
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("already used")));
                        diag.span_label(__binding_1,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("first use of `{$name}`")));
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
103#[diag("the name `{$name}` is already used for a generic parameter in this item's generic parameters", code = E0403)]
104pub(crate) struct NameAlreadyUsedInParameterList {
105    #[primary_span]
106    #[label("already used")]
107    pub(crate) span: Span,
108    #[label("first use of `{$name}`")]
109    pub(crate) first_use_span: Span,
110    pub(crate) name: Ident,
111}
112
113#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            MethodNotMemberOfTrait 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 {
                    MethodNotMemberOfTrait {
                        span: __binding_0,
                        method: __binding_1,
                        trait_: __binding_2,
                        sub: __binding_3 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("method `{$method}` is not a member of trait `{$trait_}`")));
                        diag.code(E0407);
                        ;
                        diag.arg("method", __binding_1);
                        diag.arg("trait_", __binding_2);
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("not a member of trait `{$trait_}`")));
                        if let Some(__binding_3) = __binding_3 {
                            diag.subdiagnostic(__binding_3);
                        }
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
114#[diag("method `{$method}` is not a member of trait `{$trait_}`", code = E0407)]
115pub(crate) struct MethodNotMemberOfTrait {
116    #[primary_span]
117    #[label("not a member of trait `{$trait_}`")]
118    pub(crate) span: Span,
119    pub(crate) method: Ident,
120    pub(crate) trait_: String,
121    #[subdiagnostic]
122    pub(crate) sub: Option<AssociatedFnWithSimilarNameExists>,
123}
124
125#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for AssociatedFnWithSimilarNameExists
            {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    AssociatedFnWithSimilarNameExists {
                        span: __binding_0, candidate: __binding_1 } => {
                        let __code_2 =
                            [::alloc::__export::must_use({
                                                ::alloc::fmt::format(format_args!("{0}", __binding_1))
                                            })].into_iter();
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("candidate".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_1,
                                &mut diag.long_ty_path));
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("there is an associated function with a similar name")),
                                &sub_args);
                        diag.span_suggestions_with_style(__binding_0, __message,
                            __code_2, rustc_errors::Applicability::MaybeIncorrect,
                            rustc_errors::SuggestionStyle::ShowCode);
                    }
                }
            }
        }
    };Subdiagnostic)]
126#[suggestion(
127    "there is an associated function with a similar name",
128    code = "{candidate}",
129    applicability = "maybe-incorrect"
130)]
131pub(crate) struct AssociatedFnWithSimilarNameExists {
132    #[primary_span]
133    pub(crate) span: Span,
134    pub(crate) candidate: Symbol,
135}
136
137#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            TypeNotMemberOfTrait 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 {
                    TypeNotMemberOfTrait {
                        span: __binding_0,
                        type_: __binding_1,
                        trait_: __binding_2,
                        sub: __binding_3 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("type `{$type_}` is not a member of trait `{$trait_}`")));
                        diag.code(E0437);
                        ;
                        diag.arg("type_", __binding_1);
                        diag.arg("trait_", __binding_2);
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("not a member of trait `{$trait_}`")));
                        if let Some(__binding_3) = __binding_3 {
                            diag.subdiagnostic(__binding_3);
                        }
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
138#[diag("type `{$type_}` is not a member of trait `{$trait_}`", code = E0437)]
139pub(crate) struct TypeNotMemberOfTrait {
140    #[primary_span]
141    #[label("not a member of trait `{$trait_}`")]
142    pub(crate) span: Span,
143    pub(crate) type_: Ident,
144    pub(crate) trait_: String,
145    #[subdiagnostic]
146    pub(crate) sub: Option<AssociatedTypeWithSimilarNameExists>,
147}
148
149#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for
            AssociatedTypeWithSimilarNameExists {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    AssociatedTypeWithSimilarNameExists {
                        span: __binding_0, candidate: __binding_1 } => {
                        let __code_3 =
                            [::alloc::__export::must_use({
                                                ::alloc::fmt::format(format_args!("{0}", __binding_1))
                                            })].into_iter();
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("candidate".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_1,
                                &mut diag.long_ty_path));
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("there is an associated type with a similar name")),
                                &sub_args);
                        diag.span_suggestions_with_style(__binding_0, __message,
                            __code_3, rustc_errors::Applicability::MaybeIncorrect,
                            rustc_errors::SuggestionStyle::ShowCode);
                    }
                }
            }
        }
    };Subdiagnostic)]
150#[suggestion(
151    "there is an associated type with a similar name",
152    code = "{candidate}",
153    applicability = "maybe-incorrect"
154)]
155pub(crate) struct AssociatedTypeWithSimilarNameExists {
156    #[primary_span]
157    pub(crate) span: Span,
158    pub(crate) candidate: Symbol,
159}
160
161#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            ConstNotMemberOfTrait 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 {
                    ConstNotMemberOfTrait {
                        span: __binding_0,
                        const_: __binding_1,
                        trait_: __binding_2,
                        sub: __binding_3 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("const `{$const_}` is not a member of trait `{$trait_}`")));
                        diag.code(E0438);
                        ;
                        diag.arg("const_", __binding_1);
                        diag.arg("trait_", __binding_2);
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("not a member of trait `{$trait_}`")));
                        if let Some(__binding_3) = __binding_3 {
                            diag.subdiagnostic(__binding_3);
                        }
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
162#[diag("const `{$const_}` is not a member of trait `{$trait_}`", code = E0438)]
163pub(crate) struct ConstNotMemberOfTrait {
164    #[primary_span]
165    #[label("not a member of trait `{$trait_}`")]
166    pub(crate) span: Span,
167    pub(crate) const_: Ident,
168    pub(crate) trait_: String,
169    #[subdiagnostic]
170    pub(crate) sub: Option<AssociatedConstWithSimilarNameExists>,
171}
172
173#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for
            AssociatedConstWithSimilarNameExists {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    AssociatedConstWithSimilarNameExists {
                        span: __binding_0, candidate: __binding_1 } => {
                        let __code_4 =
                            [::alloc::__export::must_use({
                                                ::alloc::fmt::format(format_args!("{0}", __binding_1))
                                            })].into_iter();
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("candidate".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_1,
                                &mut diag.long_ty_path));
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("there is an associated constant with a similar name")),
                                &sub_args);
                        diag.span_suggestions_with_style(__binding_0, __message,
                            __code_4, rustc_errors::Applicability::MaybeIncorrect,
                            rustc_errors::SuggestionStyle::ShowCode);
                    }
                }
            }
        }
    };Subdiagnostic)]
174#[suggestion(
175    "there is an associated constant with a similar name",
176    code = "{candidate}",
177    applicability = "maybe-incorrect"
178)]
179pub(crate) struct AssociatedConstWithSimilarNameExists {
180    #[primary_span]
181    pub(crate) span: Span,
182    pub(crate) candidate: Symbol,
183}
184
185#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            VariableBoundWithDifferentMode 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 {
                    VariableBoundWithDifferentMode {
                        span: __binding_0,
                        first_binding_span: __binding_1,
                        variable_name: __binding_2 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("variable `{$variable_name}` is bound inconsistently across alternatives separated by `|`")));
                        diag.code(E0409);
                        ;
                        diag.arg("variable_name", __binding_2);
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("bound in different ways")));
                        diag.span_label(__binding_1,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("first binding")));
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
186#[diag("variable `{$variable_name}` is bound inconsistently across alternatives separated by `|`", code = E0409)]
187pub(crate) struct VariableBoundWithDifferentMode {
188    #[primary_span]
189    #[label("bound in different ways")]
190    pub(crate) span: Span,
191    #[label("first binding")]
192    pub(crate) first_binding_span: Span,
193    pub(crate) variable_name: Ident,
194}
195
196#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            IdentifierBoundMoreThanOnceInParameterList 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 {
                    IdentifierBoundMoreThanOnceInParameterList {
                        span: __binding_0, identifier: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("identifier `{$identifier}` is bound more than once in this parameter list")));
                        diag.code(E0415);
                        ;
                        diag.arg("identifier", __binding_1);
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("used as parameter more than once")));
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
197#[diag("identifier `{$identifier}` is bound more than once in this parameter list", code = E0415)]
198pub(crate) struct IdentifierBoundMoreThanOnceInParameterList {
199    #[primary_span]
200    #[label("used as parameter more than once")]
201    pub(crate) span: Span,
202    pub(crate) identifier: Ident,
203}
204
205#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            IdentifierBoundMoreThanOnceInSamePattern 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 {
                    IdentifierBoundMoreThanOnceInSamePattern {
                        span: __binding_0, identifier: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("identifier `{$identifier}` is bound more than once in the same pattern")));
                        diag.code(E0416);
                        ;
                        diag.arg("identifier", __binding_1);
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("used in a pattern more than once")));
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
206#[diag("identifier `{$identifier}` is bound more than once in the same pattern", code = E0416)]
207pub(crate) struct IdentifierBoundMoreThanOnceInSamePattern {
208    #[primary_span]
209    #[label("used in a pattern more than once")]
210    pub(crate) span: Span,
211    pub(crate) identifier: Ident,
212}
213
214#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            UndeclaredLabel 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 {
                    UndeclaredLabel {
                        span: __binding_0,
                        name: __binding_1,
                        sub_reachable: __binding_2,
                        sub_reachable_suggestion: __binding_3,
                        sub_unreachable: __binding_4 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("use of undeclared label `{$name}`")));
                        diag.code(E0426);
                        ;
                        diag.arg("name", __binding_1);
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("undeclared label `{$name}`")));
                        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.subdiagnostic(__binding_4);
                        }
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
215#[diag("use of undeclared label `{$name}`", code = E0426)]
216pub(crate) struct UndeclaredLabel {
217    #[primary_span]
218    #[label("undeclared label `{$name}`")]
219    pub(crate) span: Span,
220    pub(crate) name: Symbol,
221    #[subdiagnostic]
222    pub(crate) sub_reachable: Option<LabelWithSimilarNameReachable>,
223    #[subdiagnostic]
224    pub(crate) sub_reachable_suggestion: Option<TryUsingSimilarlyNamedLabel>,
225    #[subdiagnostic]
226    pub(crate) sub_unreachable: Option<UnreachableLabelWithSimilarNameExists>,
227}
228
229#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for LabelWithSimilarNameReachable {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    LabelWithSimilarNameReachable(__binding_0) => {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("a label with a similar name is reachable")),
                                &sub_args);
                        diag.span_label(__binding_0, __message);
                    }
                }
            }
        }
    };Subdiagnostic)]
230#[label("a label with a similar name is reachable")]
231pub(crate) struct LabelWithSimilarNameReachable(#[primary_span] pub(crate) Span);
232
233#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for TryUsingSimilarlyNamedLabel {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    TryUsingSimilarlyNamedLabel {
                        span: __binding_0, ident_name: __binding_1 } => {
                        let __code_5 =
                            [::alloc::__export::must_use({
                                                ::alloc::fmt::format(format_args!("{0}", __binding_1))
                                            })].into_iter();
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("ident_name".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_1,
                                &mut diag.long_ty_path));
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("try using similarly named label")),
                                &sub_args);
                        diag.span_suggestions_with_style(__binding_0, __message,
                            __code_5, rustc_errors::Applicability::MaybeIncorrect,
                            rustc_errors::SuggestionStyle::ShowCode);
                    }
                }
            }
        }
    };Subdiagnostic)]
234#[suggestion(
235    "try using similarly named label",
236    code = "{ident_name}",
237    applicability = "maybe-incorrect"
238)]
239pub(crate) struct TryUsingSimilarlyNamedLabel {
240    #[primary_span]
241    pub(crate) span: Span,
242    pub(crate) ident_name: Symbol,
243}
244
245#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for
            UnreachableLabelWithSimilarNameExists {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    UnreachableLabelWithSimilarNameExists {
                        ident_span: __binding_0 } => {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("a label with a similar name exists but is unreachable")),
                                &sub_args);
                        diag.span_label(__binding_0, __message);
                    }
                }
            }
        }
    };Subdiagnostic)]
246#[label("a label with a similar name exists but is unreachable")]
247pub(crate) struct UnreachableLabelWithSimilarNameExists {
248    #[primary_span]
249    pub(crate) ident_span: Span,
250}
251
252#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            CannotCaptureDynamicEnvironmentInFnItem 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 {
                    CannotCaptureDynamicEnvironmentInFnItem { span: __binding_0
                        } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("can't capture dynamic environment in a fn item")));
                        diag.code(E0434);
                        diag.help(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("use the `|| {\"{\"} ... {\"}\"}` closure form instead")));
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
253#[diag("can't capture dynamic environment in a fn item", code = E0434)]
254#[help("use the `|| {\"{\"} ... {\"}\"}` closure form instead")]
255pub(crate) struct CannotCaptureDynamicEnvironmentInFnItem {
256    #[primary_span]
257    pub(crate) span: Span,
258}
259
260#[derive(const _: () =
    {
        impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
            AttemptToUseNonConstantValueInConstant<'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 {
                    AttemptToUseNonConstantValueInConstant {
                        span: __binding_0,
                        with: __binding_1,
                        with_label: __binding_2,
                        without: __binding_3 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("attempt to use a non-constant value in a constant")));
                        diag.code(E0435);
                        ;
                        diag.span(__binding_0);
                        if let Some(__binding_1) = __binding_1 {
                            diag.subdiagnostic(__binding_1);
                        }
                        if let Some(__binding_2) = __binding_2 {
                            diag.subdiagnostic(__binding_2);
                        }
                        if let Some(__binding_3) = __binding_3 {
                            diag.subdiagnostic(__binding_3);
                        }
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
261#[diag("attempt to use a non-constant value in a constant", code = E0435)]
262pub(crate) struct AttemptToUseNonConstantValueInConstant<'a> {
263    #[primary_span]
264    pub(crate) span: Span,
265    #[subdiagnostic]
266    pub(crate) with: Option<AttemptToUseNonConstantValueInConstantWithSuggestion<'a>>,
267    #[subdiagnostic]
268    pub(crate) with_label: Option<AttemptToUseNonConstantValueInConstantLabelWithSuggestion>,
269    #[subdiagnostic]
270    pub(crate) without: Option<AttemptToUseNonConstantValueInConstantWithoutSuggestion<'a>>,
271}
272
273#[derive(const _: () =
    {
        impl<'a> rustc_errors::Subdiagnostic for
            AttemptToUseNonConstantValueInConstantWithSuggestion<'a> {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    AttemptToUseNonConstantValueInConstantWithSuggestion {
                        span: __binding_0,
                        suggestion: __binding_1,
                        type_span: __binding_2,
                        current: __binding_3 } => {
                        let mut suggestions = Vec::new();
                        let __code_6 =
                            ::alloc::__export::must_use({
                                    ::alloc::fmt::format(format_args!("{0} ", __binding_1))
                                });
                        let __code_7 =
                            ::alloc::__export::must_use({
                                    ::alloc::fmt::format(format_args!(": /* Type */"))
                                });
                        suggestions.push((__binding_0, __code_6));
                        if let Some(__binding_2) = __binding_2 {
                            suggestions.push((__binding_2, __code_7));
                        }
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("suggestion".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_1,
                                &mut diag.long_ty_path));
                        sub_args.insert("current".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_3,
                                &mut diag.long_ty_path));
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("consider using `{$suggestion}` instead of `{$current}`")),
                                &sub_args);
                        diag.multipart_suggestion_with_style(__message, suggestions,
                            rustc_errors::Applicability::HasPlaceholders,
                            rustc_errors::SuggestionStyle::ShowAlways);
                    }
                }
            }
        }
    };Subdiagnostic)]
274#[multipart_suggestion(
275    "consider using `{$suggestion}` instead of `{$current}`",
276    style = "verbose",
277    applicability = "has-placeholders"
278)]
279pub(crate) struct AttemptToUseNonConstantValueInConstantWithSuggestion<'a> {
280    // #[primary_span]
281    #[suggestion_part(code = "{suggestion} ")]
282    pub(crate) span: Span,
283    pub(crate) suggestion: &'a str,
284    #[suggestion_part(code = ": /* Type */")]
285    pub(crate) type_span: Option<Span>,
286    pub(crate) current: &'a str,
287}
288
289#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for
            AttemptToUseNonConstantValueInConstantLabelWithSuggestion {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    AttemptToUseNonConstantValueInConstantLabelWithSuggestion {
                        span: __binding_0 } => {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("non-constant value")),
                                &sub_args);
                        diag.span_label(__binding_0, __message);
                    }
                }
            }
        }
    };Subdiagnostic)]
290#[label("non-constant value")]
291pub(crate) struct AttemptToUseNonConstantValueInConstantLabelWithSuggestion {
292    #[primary_span]
293    pub(crate) span: Span,
294}
295
296#[derive(const _: () =
    {
        impl<'a> rustc_errors::Subdiagnostic for
            AttemptToUseNonConstantValueInConstantWithoutSuggestion<'a> {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    AttemptToUseNonConstantValueInConstantWithoutSuggestion {
                        ident_span: __binding_0, suggestion: __binding_1 } => {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("suggestion".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_1,
                                &mut diag.long_ty_path));
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("this would need to be a `{$suggestion}`")),
                                &sub_args);
                        diag.span_label(__binding_0, __message);
                    }
                }
            }
        }
    };Subdiagnostic)]
297#[label("this would need to be a `{$suggestion}`")]
298pub(crate) struct AttemptToUseNonConstantValueInConstantWithoutSuggestion<'a> {
299    #[primary_span]
300    pub(crate) ident_span: Span,
301    pub(crate) suggestion: &'a str,
302}
303
304#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            SelfImportsOnlyAllowedWithin 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 {
                    SelfImportsOnlyAllowedWithin {
                        span: __binding_0,
                        suggestion: __binding_1,
                        mpart_suggestion: __binding_2 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`self` imports are only allowed within a {\"{\"} {\"}\"} list")));
                        diag.code(E0429);
                        ;
                        diag.span(__binding_0);
                        if let Some(__binding_1) = __binding_1 {
                            diag.subdiagnostic(__binding_1);
                        }
                        if let Some(__binding_2) = __binding_2 {
                            diag.subdiagnostic(__binding_2);
                        }
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
305#[diag("`self` imports are only allowed within a {\"{\"} {\"}\"} list", code = E0429)]
306pub(crate) struct SelfImportsOnlyAllowedWithin {
307    #[primary_span]
308    pub(crate) span: Span,
309    #[subdiagnostic]
310    pub(crate) suggestion: Option<SelfImportsOnlyAllowedWithinSuggestion>,
311    #[subdiagnostic]
312    pub(crate) mpart_suggestion: Option<SelfImportsOnlyAllowedWithinMultipartSuggestion>,
313}
314
315#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for
            SelfImportsOnlyAllowedWithinSuggestion {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    SelfImportsOnlyAllowedWithinSuggestion { span: __binding_0 }
                        => {
                        let __code_8 =
                            [::alloc::__export::must_use({
                                                ::alloc::fmt::format(format_args!(""))
                                            })].into_iter();
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("consider importing the module directly")),
                                &sub_args);
                        diag.span_suggestions_with_style(__binding_0, __message,
                            __code_8, rustc_errors::Applicability::MachineApplicable,
                            rustc_errors::SuggestionStyle::ShowCode);
                    }
                }
            }
        }
    };Subdiagnostic)]
316#[suggestion(
317    "consider importing the module directly",
318    code = "",
319    applicability = "machine-applicable"
320)]
321pub(crate) struct SelfImportsOnlyAllowedWithinSuggestion {
322    #[primary_span]
323    pub(crate) span: Span,
324}
325
326#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for
            SelfImportsOnlyAllowedWithinMultipartSuggestion {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    SelfImportsOnlyAllowedWithinMultipartSuggestion {
                        multipart_start: __binding_0, multipart_end: __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));
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("alternatively, use the multi-path `use` syntax to import `self`")),
                                &sub_args);
                        diag.multipart_suggestion_with_style(__message, suggestions,
                            rustc_errors::Applicability::MachineApplicable,
                            rustc_errors::SuggestionStyle::ShowCode);
                    }
                }
            }
        }
    };Subdiagnostic)]
327#[multipart_suggestion(
328    "alternatively, use the multi-path `use` syntax to import `self`",
329    applicability = "machine-applicable"
330)]
331pub(crate) struct SelfImportsOnlyAllowedWithinMultipartSuggestion {
332    #[suggestion_part(code = "{{")]
333    pub(crate) multipart_start: Span,
334    #[suggestion_part(code = "}}")]
335    pub(crate) multipart_end: Span,
336}
337
338#[derive(const _: () =
    {
        impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
            BindingShadowsSomethingUnacceptable<'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 {
                    BindingShadowsSomethingUnacceptable {
                        span: __binding_0,
                        shadowing_binding: __binding_1,
                        shadowed_binding: __binding_2,
                        article: __binding_3,
                        sub_suggestion: __binding_4,
                        shadowed_binding_span: __binding_5,
                        participle: __binding_6,
                        name: __binding_7 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("{$shadowing_binding}s cannot shadow {$shadowed_binding}s")));
                        diag.code(E0530);
                        ;
                        diag.arg("shadowing_binding", __binding_1);
                        diag.arg("shadowed_binding", __binding_2);
                        diag.arg("article", __binding_3);
                        diag.arg("participle", __binding_6);
                        diag.arg("name", __binding_7);
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("cannot be named the same as {$article} {$shadowed_binding}")));
                        if let Some(__binding_4) = __binding_4 {
                            diag.subdiagnostic(__binding_4);
                        }
                        diag.span_label(__binding_5,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the {$shadowed_binding} `{$name}` is {$participle} here")));
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
339#[diag("{$shadowing_binding}s cannot shadow {$shadowed_binding}s", code = E0530)]
340pub(crate) struct BindingShadowsSomethingUnacceptable<'a> {
341    #[primary_span]
342    #[label("cannot be named the same as {$article} {$shadowed_binding}")]
343    pub(crate) span: Span,
344    pub(crate) shadowing_binding: PatternSource,
345    pub(crate) shadowed_binding: Res,
346    pub(crate) article: &'a str,
347    #[subdiagnostic]
348    pub(crate) sub_suggestion: Option<BindingShadowsSomethingUnacceptableSuggestion>,
349    #[label("the {$shadowed_binding} `{$name}` is {$participle} here")]
350    pub(crate) shadowed_binding_span: Span,
351    pub(crate) participle: &'a str,
352    pub(crate) name: Symbol,
353}
354
355#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for
            BindingShadowsSomethingUnacceptableSuggestion {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    BindingShadowsSomethingUnacceptableSuggestion {
                        span: __binding_0, name: __binding_1 } => {
                        let __code_11 =
                            [::alloc::__export::must_use({
                                                ::alloc::fmt::format(format_args!("{0}(..)", __binding_1))
                                            })].into_iter();
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("name".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_1,
                                &mut diag.long_ty_path));
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("try specify the pattern arguments")),
                                &sub_args);
                        diag.span_suggestions_with_style(__binding_0, __message,
                            __code_11, rustc_errors::Applicability::Unspecified,
                            rustc_errors::SuggestionStyle::ShowCode);
                    }
                }
            }
        }
    };Subdiagnostic)]
356#[suggestion(
357    "try specify the pattern arguments",
358    code = "{name}(..)",
359    applicability = "unspecified"
360)]
361pub(crate) struct BindingShadowsSomethingUnacceptableSuggestion {
362    #[primary_span]
363    pub(crate) span: Span,
364    pub(crate) name: Symbol,
365}
366
367#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            ForwardDeclaredGenericParam 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 {
                    ForwardDeclaredGenericParam {
                        span: __binding_0, param: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("generic parameter defaults cannot reference parameters before they are declared")));
                        diag.code(E0128);
                        ;
                        diag.arg("param", __binding_1);
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("cannot reference `{$param}` before it is declared")));
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
368#[diag("generic parameter defaults cannot reference parameters before they are declared", code = E0128)]
369pub(crate) struct ForwardDeclaredGenericParam {
370    #[primary_span]
371    #[label("cannot reference `{$param}` before it is declared")]
372    pub(crate) span: Span,
373    pub(crate) param: Symbol,
374}
375
376#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            ForwardDeclaredGenericInConstParamTy 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 {
                    ForwardDeclaredGenericInConstParamTy {
                        span: __binding_0, param: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("const parameter types cannot reference parameters before they are declared")));
                        ;
                        diag.arg("param", __binding_1);
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("const parameter type cannot reference `{$param}` before it is declared")));
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
377#[diag("const parameter types cannot reference parameters before they are declared")]
378pub(crate) struct ForwardDeclaredGenericInConstParamTy {
379    #[primary_span]
380    #[label("const parameter type cannot reference `{$param}` before it is declared")]
381    pub(crate) span: Span,
382    pub(crate) param: Symbol,
383}
384
385#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            ParamInTyOfConstParam 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 {
                    ParamInTyOfConstParam { span: __binding_0, name: __binding_1
                        } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the type of const parameters must not depend on other generic parameters")));
                        diag.code(E0770);
                        ;
                        diag.arg("name", __binding_1);
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the type must not depend on the parameter `{$name}`")));
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
386#[diag("the type of const parameters must not depend on other generic parameters", code = E0770)]
387pub(crate) struct ParamInTyOfConstParam {
388    #[primary_span]
389    #[label("the type must not depend on the parameter `{$name}`")]
390    pub(crate) span: Span,
391    pub(crate) name: Symbol,
392}
393
394#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            SelfInGenericParamDefault 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 {
                    SelfInGenericParamDefault { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("generic parameters cannot use `Self` in their defaults")));
                        diag.code(E0735);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
395#[diag("generic parameters cannot use `Self` in their defaults", code = E0735)]
396pub(crate) struct SelfInGenericParamDefault {
397    #[primary_span]
398    pub(crate) span: Span,
399}
400
401#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            SelfInConstGenericTy 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 {
                    SelfInConstGenericTy { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("cannot use `Self` in const parameter type")));
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
402#[diag("cannot use `Self` in const parameter type")]
403pub(crate) struct SelfInConstGenericTy {
404    #[primary_span]
405    pub(crate) span: Span,
406}
407
408#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            ParamInNonTrivialAnonConst 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 {
                    ParamInNonTrivialAnonConst {
                        span: __binding_0,
                        name: __binding_1,
                        param_kind: __binding_2,
                        help: __binding_3,
                        is_ogca: __binding_4,
                        help_ogca: __binding_5 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("{$is_ogca ->\n    [true] generic parameters in const blocks are only allowed as the direct value of a `type const`\n    *[false] generic parameters may not be used in const operations\n}")));
                        ;
                        diag.arg("name", __binding_1);
                        diag.arg("is_ogca", __binding_4);
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("cannot perform const operation using `{$name}`")));
                        diag.subdiagnostic(__binding_2);
                        if __binding_3 {
                            diag.help(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("add `#![feature(generic_const_exprs)]` to allow generic const expressions")));
                        }
                        if __binding_5 {
                            diag.help(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("consider factoring the expression into a `type const` item and use it as the const argument instead")));
                        }
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
409#[diag(
410    "{$is_ogca ->
411    [true] generic parameters in const blocks are only allowed as the direct value of a `type const`
412    *[false] generic parameters may not be used in const operations
413}"
414)]
415pub(crate) struct ParamInNonTrivialAnonConst {
416    #[primary_span]
417    #[label("cannot perform const operation using `{$name}`")]
418    pub(crate) span: Span,
419    pub(crate) name: Symbol,
420    #[subdiagnostic]
421    pub(crate) param_kind: ParamKindInNonTrivialAnonConst,
422    #[help("add `#![feature(generic_const_exprs)]` to allow generic const expressions")]
423    pub(crate) help: bool,
424    pub(crate) is_ogca: bool,
425    #[help(
426        "consider factoring the expression into a `type const` item and use it as the const argument instead"
427    )]
428    pub(crate) help_ogca: bool,
429}
430
431#[derive(#[automatically_derived]
impl ::core::fmt::Debug for ParamKindInNonTrivialAnonConst {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            ParamKindInNonTrivialAnonConst::Type =>
                ::core::fmt::Formatter::write_str(f, "Type"),
            ParamKindInNonTrivialAnonConst::Const { name: __self_0 } =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f, "Const",
                    "name", &__self_0),
            ParamKindInNonTrivialAnonConst::Lifetime =>
                ::core::fmt::Formatter::write_str(f, "Lifetime"),
        }
    }
}Debug)]
432#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for ParamKindInNonTrivialAnonConst {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    ParamKindInNonTrivialAnonConst::Type => {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("type parameters may not be used in const expressions")),
                                &sub_args);
                        diag.note(__message);
                    }
                    ParamKindInNonTrivialAnonConst::Const { name: __binding_0 }
                        => {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("name".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_0,
                                &mut diag.long_ty_path));
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("const parameters may only be used as standalone arguments here, i.e. `{$name}`")),
                                &sub_args);
                        diag.help(__message);
                    }
                    ParamKindInNonTrivialAnonConst::Lifetime => {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("lifetime parameters may not be used in const expressions")),
                                &sub_args);
                        diag.note(__message);
                    }
                }
            }
        }
    };Subdiagnostic)]
433pub(crate) enum ParamKindInNonTrivialAnonConst {
434    #[note("type parameters may not be used in const expressions")]
435    Type,
436    #[help("const parameters may only be used as standalone arguments here, i.e. `{$name}`")]
437    Const { name: Symbol },
438    #[note("lifetime parameters may not be used in const expressions")]
439    Lifetime,
440}
441
442#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            UnreachableLabel 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 {
                    UnreachableLabel {
                        span: __binding_0,
                        name: __binding_1,
                        definition_span: __binding_2,
                        sub_suggestion: __binding_3,
                        sub_suggestion_label: __binding_4,
                        sub_unreachable_label: __binding_5 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("use of unreachable label `{$name}`")));
                        diag.code(E0767);
                        diag.note(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("labels are unreachable through functions, closures, async blocks and modules")));
                        ;
                        diag.arg("name", __binding_1);
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("unreachable label `{$name}`")));
                        diag.span_label(__binding_2,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("unreachable label defined here")));
                        if let Some(__binding_3) = __binding_3 {
                            diag.subdiagnostic(__binding_3);
                        }
                        if let Some(__binding_4) = __binding_4 {
                            diag.subdiagnostic(__binding_4);
                        }
                        if let Some(__binding_5) = __binding_5 {
                            diag.subdiagnostic(__binding_5);
                        }
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
443#[diag("use of unreachable label `{$name}`", code = E0767)]
444#[note("labels are unreachable through functions, closures, async blocks and modules")]
445pub(crate) struct UnreachableLabel {
446    #[primary_span]
447    #[label("unreachable label `{$name}`")]
448    pub(crate) span: Span,
449    pub(crate) name: Symbol,
450    #[label("unreachable label defined here")]
451    pub(crate) definition_span: Span,
452    #[subdiagnostic]
453    pub(crate) sub_suggestion: Option<UnreachableLabelSubSuggestion>,
454    #[subdiagnostic]
455    pub(crate) sub_suggestion_label: Option<UnreachableLabelSubLabel>,
456    #[subdiagnostic]
457    pub(crate) sub_unreachable_label: Option<UnreachableLabelSubLabelUnreachable>,
458}
459
460#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for UnreachableLabelSubSuggestion {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    UnreachableLabelSubSuggestion {
                        span: __binding_0, ident_name: __binding_1 } => {
                        let __code_12 =
                            [::alloc::__export::must_use({
                                                ::alloc::fmt::format(format_args!("{0}", __binding_1))
                                            })].into_iter();
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("ident_name".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_1,
                                &mut diag.long_ty_path));
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("try using similarly named label")),
                                &sub_args);
                        diag.span_suggestions_with_style(__binding_0, __message,
                            __code_12, rustc_errors::Applicability::MaybeIncorrect,
                            rustc_errors::SuggestionStyle::ShowCode);
                    }
                }
            }
        }
    };Subdiagnostic)]
461#[suggestion(
462    "try using similarly named label",
463    code = "{ident_name}",
464    applicability = "maybe-incorrect"
465)]
466pub(crate) struct UnreachableLabelSubSuggestion {
467    #[primary_span]
468    pub(crate) span: Span,
469    pub(crate) ident_name: Symbol,
470}
471
472#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for UnreachableLabelSubLabel {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    UnreachableLabelSubLabel { ident_span: __binding_0 } => {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("a label with a similar name is reachable")),
                                &sub_args);
                        diag.span_label(__binding_0, __message);
                    }
                }
            }
        }
    };Subdiagnostic)]
473#[label("a label with a similar name is reachable")]
474pub(crate) struct UnreachableLabelSubLabel {
475    #[primary_span]
476    pub(crate) ident_span: Span,
477}
478
479#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for
            UnreachableLabelSubLabelUnreachable {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    UnreachableLabelSubLabelUnreachable {
                        ident_span: __binding_0 } => {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("a label with a similar name exists but is also unreachable")),
                                &sub_args);
                        diag.span_label(__binding_0, __message);
                    }
                }
            }
        }
    };Subdiagnostic)]
480#[label("a label with a similar name exists but is also unreachable")]
481pub(crate) struct UnreachableLabelSubLabelUnreachable {
482    #[primary_span]
483    pub(crate) ident_span: Span,
484}
485
486#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for InvalidAsmSym
            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 {
                    InvalidAsmSym { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("invalid `sym` operand")));
                        diag.help(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`sym` operands must refer to either a function or a static")));
                        ;
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("is a local variable")));
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
487#[diag("invalid `sym` operand")]
488#[help("`sym` operands must refer to either a function or a static")]
489pub(crate) struct InvalidAsmSym {
490    #[primary_span]
491    #[label("is a local variable")]
492    pub(crate) span: Span,
493}
494
495#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for LowercaseSelf
            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 {
                    LowercaseSelf { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("attempt to use a non-constant value in a constant")));
                        let __code_13 =
                            [::alloc::__export::must_use({
                                                ::alloc::fmt::format(format_args!("Self"))
                                            })].into_iter();
                        ;
                        diag.span(__binding_0);
                        diag.span_suggestions_with_style(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("try using `Self`")),
                            __code_13, rustc_errors::Applicability::MaybeIncorrect,
                            rustc_errors::SuggestionStyle::HideCodeInline);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
496#[diag("attempt to use a non-constant value in a constant")]
497pub(crate) struct LowercaseSelf {
498    #[primary_span]
499    #[suggestion(
500        "try using `Self`",
501        code = "Self",
502        applicability = "maybe-incorrect",
503        style = "short"
504    )]
505    pub(crate) span: Span,
506}
507
508#[derive(#[automatically_derived]
impl ::core::fmt::Debug for BindingInNeverPattern {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field1_finish(f,
            "BindingInNeverPattern", "span", &&self.span)
    }
}Debug)]
509#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            BindingInNeverPattern 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 {
                    BindingInNeverPattern { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("never patterns cannot contain variable bindings")));
                        let __code_14 =
                            [::alloc::__export::must_use({
                                                ::alloc::fmt::format(format_args!("_"))
                                            })].into_iter();
                        ;
                        diag.span(__binding_0);
                        diag.span_suggestions_with_style(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("use a wildcard `_` instead")),
                            __code_14, rustc_errors::Applicability::MachineApplicable,
                            rustc_errors::SuggestionStyle::HideCodeInline);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
510#[diag("never patterns cannot contain variable bindings")]
511pub(crate) struct BindingInNeverPattern {
512    #[primary_span]
513    #[suggestion(
514        "use a wildcard `_` instead",
515        code = "_",
516        applicability = "machine-applicable",
517        style = "short"
518    )]
519    pub(crate) span: Span,
520}
521
522#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            TraitImplDuplicate 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 {
                    TraitImplDuplicate {
                        span: __binding_0,
                        old_span: __binding_1,
                        trait_item_span: __binding_2,
                        name: __binding_3 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("duplicate definitions with name `{$name}`:")));
                        diag.code(E0201);
                        ;
                        diag.arg("name", __binding_3);
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("duplicate definition")));
                        diag.span_label(__binding_1,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("previous definition here")));
                        diag.span_label(__binding_2,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("item in trait")));
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
523#[diag("duplicate definitions with name `{$name}`:", code = E0201)]
524pub(crate) struct TraitImplDuplicate {
525    #[primary_span]
526    #[label("duplicate definition")]
527    pub(crate) span: Span,
528    #[label("previous definition here")]
529    pub(crate) old_span: Span,
530    #[label("item in trait")]
531    pub(crate) trait_item_span: Span,
532    pub(crate) name: Ident,
533}
534
535#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for Relative2018
            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 {
                    Relative2018 {
                        span: __binding_0,
                        path_span: __binding_1,
                        path_str: __binding_2 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("relative paths are not supported in visibilities in 2018 edition or later")));
                        let __code_15 =
                            [::alloc::__export::must_use({
                                                ::alloc::fmt::format(format_args!("crate::{0}",
                                                        __binding_2))
                                            })].into_iter();
                        ;
                        diag.arg("path_str", __binding_2);
                        diag.span(__binding_0);
                        diag.span_suggestions_with_style(__binding_1,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("try")),
                            __code_15, rustc_errors::Applicability::MaybeIncorrect,
                            rustc_errors::SuggestionStyle::ShowCode);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
536#[diag("relative paths are not supported in visibilities in 2018 edition or later")]
537pub(crate) struct Relative2018 {
538    #[primary_span]
539    pub(crate) span: Span,
540    #[suggestion("try", code = "crate::{path_str}", applicability = "maybe-incorrect")]
541    pub(crate) path_span: Span,
542    pub(crate) path_str: String,
543}
544
545#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for AncestorOnly
            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 {
                    AncestorOnly(__binding_0) => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("visibilities can only be restricted to ancestor modules")));
                        diag.code(E0742);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
546#[diag("visibilities can only be restricted to ancestor modules", code = E0742)]
547pub(crate) struct AncestorOnly(#[primary_span] pub(crate) Span);
548
549#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            ExpectedModuleFound 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 {
                    ExpectedModuleFound {
                        span: __binding_0, res: __binding_1, path_str: __binding_2 }
                        => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("expected module, found {$res} `{$path_str}`")));
                        diag.code(E0577);
                        ;
                        diag.arg("res", __binding_1);
                        diag.arg("path_str", __binding_2);
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("not a module")));
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
550#[diag("expected module, found {$res} `{$path_str}`", code = E0577)]
551pub(crate) struct ExpectedModuleFound {
552    #[primary_span]
553    #[label("not a module")]
554    pub(crate) span: Span,
555    pub(crate) res: Res,
556    pub(crate) path_str: String,
557}
558
559#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for Indeterminate
            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 {
                    Indeterminate(__binding_0) => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("cannot determine resolution for the visibility")));
                        diag.code(E0578);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
560#[diag("cannot determine resolution for the visibility", code = E0578)]
561pub(crate) struct Indeterminate(#[primary_span] pub(crate) Span);
562
563#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            RestrictionAncestorOnly 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 {
                    RestrictionAncestorOnly(__binding_0) => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("trait implementation can only be restricted to ancestor modules")));
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
564#[diag("trait implementation can only be restricted to ancestor modules")]
565pub(crate) struct RestrictionAncestorOnly(#[primary_span] pub(crate) Span);
566
567#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            ToolModuleImported 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 {
                    ToolModuleImported { span: __binding_0, import: __binding_1
                        } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("cannot use a tool module through an import")));
                        ;
                        diag.span(__binding_0);
                        diag.span_note(__binding_1,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the tool module imported here")));
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
568#[diag("cannot use a tool module through an import")]
569pub(crate) struct ToolModuleImported {
570    #[primary_span]
571    pub(crate) span: Span,
572    #[note("the tool module imported here")]
573    pub(crate) import: Span,
574}
575
576#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for ModuleOnly
            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 {
                    ModuleOnly(__binding_0) => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("visibility must resolve to a module")));
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
577#[diag("visibility must resolve to a module")]
578pub(crate) struct ModuleOnly(#[primary_span] pub(crate) Span);
579
580#[derive(const _: () =
    {
        impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
            MacroExpectedFound<'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 {
                    MacroExpectedFound {
                        span: __binding_0,
                        found: __binding_1,
                        article: __binding_2,
                        expected: __binding_3,
                        macro_path: __binding_4,
                        remove_surrounding_derive: __binding_5,
                        add_as_non_derive: __binding_6 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("expected {$expected}, found {$found} `{$macro_path}`")));
                        ;
                        diag.arg("found", __binding_1);
                        diag.arg("article", __binding_2);
                        diag.arg("expected", __binding_3);
                        diag.arg("macro_path", __binding_4);
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("not {$article} {$expected}")));
                        if let Some(__binding_5) = __binding_5 {
                            diag.subdiagnostic(__binding_5);
                        }
                        if let Some(__binding_6) = __binding_6 {
                            diag.subdiagnostic(__binding_6);
                        }
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
581#[diag("expected {$expected}, found {$found} `{$macro_path}`")]
582pub(crate) struct MacroExpectedFound<'a> {
583    #[primary_span]
584    #[label("not {$article} {$expected}")]
585    pub(crate) span: Span,
586    pub(crate) found: &'a str,
587    pub(crate) article: &'static str,
588    pub(crate) expected: &'a str,
589    pub(crate) macro_path: &'a str,
590    #[subdiagnostic]
591    pub(crate) remove_surrounding_derive: Option<RemoveSurroundingDerive>,
592    #[subdiagnostic]
593    pub(crate) add_as_non_derive: Option<AddAsNonDerive<'a>>,
594}
595
596#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for RemoveSurroundingDerive {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    RemoveSurroundingDerive { span: __binding_0 } => {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("remove from the surrounding `derive()`")),
                                &sub_args);
                        diag.span_help(__binding_0, __message);
                    }
                }
            }
        }
    };Subdiagnostic)]
597#[help("remove from the surrounding `derive()`")]
598pub(crate) struct RemoveSurroundingDerive {
599    #[primary_span]
600    pub(crate) span: Span,
601}
602
603#[derive(const _: () =
    {
        impl<'a> rustc_errors::Subdiagnostic for AddAsNonDerive<'a> {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    AddAsNonDerive { macro_path: __binding_0 } => {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("macro_path".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_0,
                                &mut diag.long_ty_path));
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("\n    add as non-Derive macro\n    `#[{$macro_path}]`")),
                                &sub_args);
                        diag.help(__message);
                    }
                }
            }
        }
    };Subdiagnostic)]
604#[help(
605    "
606    add as non-Derive macro
607    `#[{$macro_path}]`"
608)]
609pub(crate) struct AddAsNonDerive<'a> {
610    pub(crate) macro_path: &'a str,
611}
612
613#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            ProcMacroSameCrate 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 {
                    ProcMacroSameCrate { span: __binding_0, is_test: __binding_1
                        } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("can't use a procedural macro from the same crate that defines it")));
                        ;
                        diag.span(__binding_0);
                        if __binding_1 {
                            diag.help(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("you can define integration tests in a directory named `tests`")));
                        }
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
614#[diag("can't use a procedural macro from the same crate that defines it")]
615pub(crate) struct ProcMacroSameCrate {
616    #[primary_span]
617    pub(crate) span: Span,
618    #[help("you can define integration tests in a directory named `tests`")]
619    pub(crate) is_test: bool,
620}
621
622#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            ProcMacroDeriveResolutionFallback 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 {
                    ProcMacroDeriveResolutionFallback {
                        span: __binding_0, ns_descr: __binding_1, ident: __binding_2
                        } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("cannot find {$ns_descr} `{$ident}` in this scope")));
                        ;
                        diag.arg("ns_descr", __binding_1);
                        diag.arg("ident", __binding_2);
                        diag.span_label(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("names from parent modules are not accessible without an explicit import")));
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
623#[diag("cannot find {$ns_descr} `{$ident}` in this scope")]
624pub(crate) struct ProcMacroDeriveResolutionFallback {
625    #[label("names from parent modules are not accessible without an explicit import")]
626    pub span: Span,
627    pub ns_descr: &'static str,
628    pub ident: Symbol,
629}
630
631#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            MacroExpandedMacroExportsAccessedByAbsolutePaths 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 {
                    MacroExpandedMacroExportsAccessedByAbsolutePaths {
                        definition: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("macro-expanded `macro_export` macros from the current crate cannot be referred to by absolute paths")));
                        ;
                        diag.span_note(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the macro is defined here")));
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
632#[diag(
633    "macro-expanded `macro_export` macros from the current crate cannot be referred to by absolute paths"
634)]
635pub(crate) struct MacroExpandedMacroExportsAccessedByAbsolutePaths {
636    #[note("the macro is defined here")]
637    pub definition: Span,
638}
639
640#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            MacroUseExternCrateSelf 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 {
                    MacroUseExternCrateSelf { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`#[macro_use]` is not supported on `extern crate self`")));
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
641#[diag("`#[macro_use]` is not supported on `extern crate self`")]
642pub(crate) struct MacroUseExternCrateSelf {
643    #[primary_span]
644    pub(crate) span: Span,
645}
646
647#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            CfgAccessibleUnsure 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 {
                    CfgAccessibleUnsure { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("not sure whether the path is accessible or not")));
                        diag.note(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the type may have associated items, but we are currently not checking them")));
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
648#[diag("not sure whether the path is accessible or not")]
649#[note("the type may have associated items, but we are currently not checking them")]
650pub(crate) struct CfgAccessibleUnsure {
651    #[primary_span]
652    pub(crate) span: Span,
653}
654
655#[derive(#[automatically_derived]
impl ::core::fmt::Debug for ParamInEnumDiscriminant {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field3_finish(f,
            "ParamInEnumDiscriminant", "span", &self.span, "name", &self.name,
            "param_kind", &&self.param_kind)
    }
}Debug)]
656#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            ParamInEnumDiscriminant 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 {
                    ParamInEnumDiscriminant {
                        span: __binding_0,
                        name: __binding_1,
                        param_kind: __binding_2 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("generic parameters may not be used in enum discriminant values")));
                        ;
                        diag.arg("name", __binding_1);
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("cannot perform const operation using `{$name}`")));
                        diag.subdiagnostic(__binding_2);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
657#[diag("generic parameters may not be used in enum discriminant values")]
658pub(crate) struct ParamInEnumDiscriminant {
659    #[primary_span]
660    #[label("cannot perform const operation using `{$name}`")]
661    pub(crate) span: Span,
662    pub(crate) name: Symbol,
663    #[subdiagnostic]
664    pub(crate) param_kind: ParamKindInEnumDiscriminant,
665}
666
667#[derive(#[automatically_derived]
impl ::core::fmt::Debug for ParamKindInEnumDiscriminant {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self {
                ParamKindInEnumDiscriminant::Type => "Type",
                ParamKindInEnumDiscriminant::Const => "Const",
                ParamKindInEnumDiscriminant::Lifetime => "Lifetime",
            })
    }
}Debug)]
668#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for ParamKindInEnumDiscriminant {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    ParamKindInEnumDiscriminant::Type => {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("type parameters may not be used in enum discriminant values")),
                                &sub_args);
                        diag.note(__message);
                    }
                    ParamKindInEnumDiscriminant::Const => {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("const parameters may not be used in enum discriminant values")),
                                &sub_args);
                        diag.note(__message);
                    }
                    ParamKindInEnumDiscriminant::Lifetime => {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("lifetime parameters may not be used in enum discriminant values")),
                                &sub_args);
                        diag.note(__message);
                    }
                }
            }
        }
    };Subdiagnostic)]
669pub(crate) enum ParamKindInEnumDiscriminant {
670    #[note("type parameters may not be used in enum discriminant values")]
671    Type,
672    #[note("const parameters may not be used in enum discriminant values")]
673    Const,
674    #[note("lifetime parameters may not be used in enum discriminant values")]
675    Lifetime,
676}
677
678#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for ChangeImportBinding {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    ChangeImportBinding { span: __binding_0 } => {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("you can use `as` to change the binding name of the import")),
                                &sub_args);
                        diag.span_label(__binding_0, __message);
                    }
                }
            }
        }
    };Subdiagnostic)]
679#[label("you can use `as` to change the binding name of the import")]
680pub(crate) struct ChangeImportBinding {
681    #[primary_span]
682    pub(crate) span: Span,
683}
684
685#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for ChangeImportBindingSuggestion {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    ChangeImportBindingSuggestion {
                        span: __binding_0, suggestion: __binding_1 } => {
                        let __code_16 =
                            [::alloc::__export::must_use({
                                                ::alloc::fmt::format(format_args!("{0}", __binding_1))
                                            })].into_iter();
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("suggestion".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_1,
                                &mut diag.long_ty_path));
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("you can use `as` to change the binding name of the import")),
                                &sub_args);
                        diag.span_suggestions_with_style(__binding_0, __message,
                            __code_16, rustc_errors::Applicability::MaybeIncorrect,
                            rustc_errors::SuggestionStyle::ShowCode);
                    }
                }
            }
        }
    };Subdiagnostic)]
686#[suggestion(
687    "you can use `as` to change the binding name of the import",
688    code = "{suggestion}",
689    applicability = "maybe-incorrect"
690)]
691pub(crate) struct ChangeImportBindingSuggestion {
692    #[primary_span]
693    pub(crate) span: Span,
694    pub(crate) suggestion: String,
695}
696
697#[derive(const _: () =
    {
        impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
            ImportsCannotReferTo<'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 {
                    ImportsCannotReferTo { span: __binding_0, what: __binding_1
                        } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("imports cannot refer to {$what}")));
                        ;
                        diag.arg("what", __binding_1);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
698#[diag("imports cannot refer to {$what}")]
699pub(crate) struct ImportsCannotReferTo<'a> {
700    #[primary_span]
701    pub(crate) span: Span,
702    pub(crate) what: &'a str,
703}
704
705#[derive(const _: () =
    {
        impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
            CannotFindIdentInThisScope<'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 {
                    CannotFindIdentInThisScope {
                        span: __binding_0, expected: __binding_1, ident: __binding_2
                        } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("cannot find {$expected} `{$ident}` in this scope")));
                        ;
                        diag.arg("expected", __binding_1);
                        diag.arg("ident", __binding_2);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
706#[diag("cannot find {$expected} `{$ident}` in this scope")]
707pub(crate) struct CannotFindIdentInThisScope<'a> {
708    #[primary_span]
709    pub(crate) span: Span,
710    pub(crate) expected: &'a str,
711    pub(crate) ident: Ident,
712}
713
714#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for ExplicitUnsafeTraits {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    ExplicitUnsafeTraits { span: __binding_0, ident: __binding_1
                        } => {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("ident".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_1,
                                &mut diag.long_ty_path));
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("unsafe traits like `{$ident}` should be implemented explicitly")),
                                &sub_args);
                        diag.span_note(__binding_0, __message);
                    }
                }
            }
        }
    };Subdiagnostic)]
715#[note("unsafe traits like `{$ident}` should be implemented explicitly")]
716pub(crate) struct ExplicitUnsafeTraits {
717    #[primary_span]
718    pub(crate) span: Span,
719    pub(crate) ident: Ident,
720}
721
722#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for MacroDefinedLater {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    MacroDefinedLater { span: __binding_0 } => {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("a macro with the same name exists, but it appears later")),
                                &sub_args);
                        diag.span_note(__binding_0, __message);
                    }
                }
            }
        }
    };Subdiagnostic)]
723#[note("a macro with the same name exists, but it appears later")]
724pub(crate) struct MacroDefinedLater {
725    #[primary_span]
726    pub(crate) span: Span,
727}
728
729#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for MacroSuggMovePosition {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    MacroSuggMovePosition {
                        span: __binding_0, ident: __binding_1 } => {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("ident".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_1,
                                &mut diag.long_ty_path));
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("consider moving the definition of `{$ident}` before this call")),
                                &sub_args);
                        diag.span_label(__binding_0, __message);
                    }
                }
            }
        }
    };Subdiagnostic)]
730#[label("consider moving the definition of `{$ident}` before this call")]
731pub(crate) struct MacroSuggMovePosition {
732    #[primary_span]
733    pub(crate) span: Span,
734    pub(crate) ident: Ident,
735}
736
737#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for MacroRulesNot {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    MacroRulesNot::Func { span: __binding_0, ident: __binding_1
                        } => {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("ident".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_1,
                                &mut diag.long_ty_path));
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`{$ident}` exists, but has no rules for function-like invocation")),
                                &sub_args);
                        diag.span_label(__binding_0, __message);
                    }
                    MacroRulesNot::Attr { span: __binding_0, ident: __binding_1
                        } => {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("ident".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_1,
                                &mut diag.long_ty_path));
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`{$ident}` exists, but has no `attr` rules")),
                                &sub_args);
                        diag.span_label(__binding_0, __message);
                    }
                    MacroRulesNot::Derive {
                        span: __binding_0, ident: __binding_1 } => {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("ident".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_1,
                                &mut diag.long_ty_path));
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`{$ident}` exists, but has no `derive` rules")),
                                &sub_args);
                        diag.span_label(__binding_0, __message);
                    }
                }
            }
        }
    };Subdiagnostic)]
738pub(crate) enum MacroRulesNot {
739    #[label("`{$ident}` exists, but has no rules for function-like invocation")]
740    Func {
741        #[primary_span]
742        span: Span,
743        ident: Ident,
744    },
745    #[label("`{$ident}` exists, but has no `attr` rules")]
746    Attr {
747        #[primary_span]
748        span: Span,
749        ident: Ident,
750    },
751    #[label("`{$ident}` exists, but has no `derive` rules")]
752    Derive {
753        #[primary_span]
754        span: Span,
755        ident: Ident,
756    },
757}
758
759#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for MaybeMissingMacroRulesName {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    MaybeMissingMacroRulesName { spans: __binding_0 } => {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("maybe you have forgotten to define a name for this `macro_rules!`")),
                                &sub_args);
                        diag.span_note(__binding_0, __message);
                    }
                }
            }
        }
    };Subdiagnostic)]
760#[note("maybe you have forgotten to define a name for this `macro_rules!`")]
761pub(crate) struct MaybeMissingMacroRulesName {
762    #[primary_span]
763    pub(crate) spans: MultiSpan,
764}
765
766#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for AddedMacroUse {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    AddedMacroUse => {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("have you added the `#[macro_use]` on the module/import?")),
                                &sub_args);
                        diag.help(__message);
                    }
                }
            }
        }
    };Subdiagnostic)]
767#[help("have you added the `#[macro_use]` on the module/import?")]
768pub(crate) struct AddedMacroUse;
769
770#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for ConsiderAddingADerive {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    ConsiderAddingADerive {
                        span: __binding_0, suggestion: __binding_1 } => {
                        let __code_17 =
                            [::alloc::__export::must_use({
                                                ::alloc::fmt::format(format_args!("{0}", __binding_1))
                                            })].into_iter();
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("suggestion".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_1,
                                &mut diag.long_ty_path));
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("consider adding a derive")),
                                &sub_args);
                        diag.span_suggestions_with_style(__binding_0, __message,
                            __code_17, rustc_errors::Applicability::MaybeIncorrect,
                            rustc_errors::SuggestionStyle::ShowCode);
                    }
                }
            }
        }
    };Subdiagnostic)]
771#[suggestion("consider adding a derive", code = "{suggestion}", applicability = "maybe-incorrect")]
772pub(crate) struct ConsiderAddingADerive {
773    #[primary_span]
774    pub(crate) span: Span,
775    pub(crate) suggestion: String,
776}
777
778#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            CannotDetermineImportResolution 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 {
                    CannotDetermineImportResolution { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("cannot determine resolution for the import")));
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
779#[diag("cannot determine resolution for the import")]
780pub(crate) struct CannotDetermineImportResolution {
781    #[primary_span]
782    pub(crate) span: Span,
783}
784
785#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            CannotDetermineMacroResolution 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 {
                    CannotDetermineMacroResolution {
                        span: __binding_0, kind: __binding_1, path: __binding_2 } =>
                        {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("cannot determine resolution for the {$kind} `{$path}`")));
                        diag.note(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("import resolution is stuck, try simplifying macro imports")));
                        ;
                        diag.arg("kind", __binding_1);
                        diag.arg("path", __binding_2);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
786#[diag("cannot determine resolution for the {$kind} `{$path}`")]
787#[note("import resolution is stuck, try simplifying macro imports")]
788pub(crate) struct CannotDetermineMacroResolution {
789    #[primary_span]
790    pub(crate) span: Span,
791    pub(crate) kind: &'static str,
792    pub(crate) path: String,
793}
794
795#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            CannotBeReexportedPrivate 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 {
                    CannotBeReexportedPrivate {
                        span: __binding_0, ident: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`{$ident}` is private, and cannot be re-exported")));
                        diag.code(E0364);
                        ;
                        diag.arg("ident", __binding_1);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
796#[diag("`{$ident}` is private, and cannot be re-exported", code = E0364)]
797pub(crate) struct CannotBeReexportedPrivate {
798    #[primary_span]
799    pub(crate) span: Span,
800    pub(crate) ident: Ident,
801}
802
803#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            CannotBeReexportedCratePublic 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 {
                    CannotBeReexportedCratePublic {
                        span: __binding_0, ident: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`{$ident}` is only public within the crate, and cannot be re-exported outside")));
                        diag.code(E0364);
                        ;
                        diag.arg("ident", __binding_1);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
804#[diag("`{$ident}` is only public within the crate, and cannot be re-exported outside", code = E0364)]
805pub(crate) struct CannotBeReexportedCratePublic {
806    #[primary_span]
807    pub(crate) span: Span,
808    pub(crate) ident: Ident,
809}
810
811#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            CannotBeReexportedPrivateNS 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 {
                    CannotBeReexportedPrivateNS {
                        span: __binding_0, ident: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`{$ident}` is private, and cannot be re-exported")));
                        diag.code(E0365);
                        diag.note(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("consider declaring type or module `{$ident}` with `pub`")));
                        ;
                        diag.arg("ident", __binding_1);
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("re-export of private `{$ident}`")));
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
812#[diag("`{$ident}` is private, and cannot be re-exported", code = E0365)]
813#[note("consider declaring type or module `{$ident}` with `pub`")]
814pub(crate) struct CannotBeReexportedPrivateNS {
815    #[primary_span]
816    #[label("re-export of private `{$ident}`")]
817    pub(crate) span: Span,
818    pub(crate) ident: Ident,
819}
820
821#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            CannotBeReexportedCratePublicNS 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 {
                    CannotBeReexportedCratePublicNS {
                        span: __binding_0, ident: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`{$ident}` is only public within the crate, and cannot be re-exported outside")));
                        diag.code(E0365);
                        diag.note(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("consider declaring type or module `{$ident}` with `pub`")));
                        ;
                        diag.arg("ident", __binding_1);
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("re-export of crate public `{$ident}`")));
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
822#[diag("`{$ident}` is only public within the crate, and cannot be re-exported outside", code = E0365)]
823#[note("consider declaring type or module `{$ident}` with `pub`")]
824pub(crate) struct CannotBeReexportedCratePublicNS {
825    #[primary_span]
826    #[label("re-export of crate public `{$ident}`")]
827    pub(crate) span: Span,
828    pub(crate) ident: Ident,
829}
830
831#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            PrivateExternCrateReexport 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 {
                    PrivateExternCrateReexport {
                        ident: __binding_0, sugg: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("extern crate `{$ident}` is private and cannot be re-exported")));
                        let __code_18 =
                            [::alloc::__export::must_use({
                                                ::alloc::fmt::format(format_args!("pub "))
                                            })].into_iter();
                        diag.code(E0365);
                        ;
                        diag.arg("ident", __binding_0);
                        diag.span_suggestions_with_style(__binding_1,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("consider making the `extern crate` item publicly accessible")),
                            __code_18, rustc_errors::Applicability::MaybeIncorrect,
                            rustc_errors::SuggestionStyle::ShowAlways);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
832#[diag("extern crate `{$ident}` is private and cannot be re-exported", code = E0365)]
833pub(crate) struct PrivateExternCrateReexport {
834    pub ident: Ident,
835    #[suggestion(
836        "consider making the `extern crate` item publicly accessible",
837        code = "pub ",
838        style = "verbose",
839        applicability = "maybe-incorrect"
840    )]
841    pub sugg: Span,
842}
843
844#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for ConsiderAddingMacroExport {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    ConsiderAddingMacroExport { span: __binding_0 } => {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("consider adding a `#[macro_export]` to the macro in the imported module")),
                                &sub_args);
                        diag.span_help(__binding_0, __message);
                    }
                }
            }
        }
    };Subdiagnostic)]
845#[help("consider adding a `#[macro_export]` to the macro in the imported module")]
846pub(crate) struct ConsiderAddingMacroExport {
847    #[primary_span]
848    pub(crate) span: Span,
849}
850
851#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for ConsiderMarkingAsPubCrate {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    ConsiderMarkingAsPubCrate { vis_span: __binding_0 } => {
                        let __code_19 =
                            [::alloc::__export::must_use({
                                                ::alloc::fmt::format(format_args!("pub(crate)"))
                                            })].into_iter();
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("in case you want to use the macro within this crate only, reduce the visibility to `pub(crate)`")),
                                &sub_args);
                        diag.span_suggestions_with_style(__binding_0, __message,
                            __code_19, rustc_errors::Applicability::MaybeIncorrect,
                            rustc_errors::SuggestionStyle::ShowCode);
                    }
                }
            }
        }
    };Subdiagnostic)]
852#[suggestion(
853    "in case you want to use the macro within this crate only, reduce the visibility to `pub(crate)`",
854    code = "pub(crate)",
855    applicability = "maybe-incorrect"
856)]
857pub(crate) struct ConsiderMarkingAsPubCrate {
858    #[primary_span]
859    pub(crate) vis_span: Span,
860}
861
862#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for ConsiderMarkingAsPub {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    ConsiderMarkingAsPub { span: __binding_0, ident: __binding_1
                        } => {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("ident".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_1,
                                &mut diag.long_ty_path));
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("consider marking `{$ident}` as `pub` in the imported module")),
                                &sub_args);
                        diag.span_note(__binding_0, __message);
                    }
                }
            }
        }
    };Subdiagnostic)]
863#[note("consider marking `{$ident}` as `pub` in the imported module")]
864pub(crate) struct ConsiderMarkingAsPub {
865    #[primary_span]
866    pub(crate) span: Span,
867    pub(crate) ident: Ident,
868}
869
870#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            CannotGlobImportAllCrates 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 {
                    CannotGlobImportAllCrates { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("cannot glob-import all possible crates")));
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
871#[diag("cannot glob-import all possible crates")]
872pub(crate) struct CannotGlobImportAllCrates {
873    #[primary_span]
874    pub(crate) span: Span,
875}
876
877#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for
            UnexpectedResChangeTyToConstParamSugg {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    UnexpectedResChangeTyToConstParamSugg {
                        span: __binding_0, applicability: __binding_1 } => {
                        let __code_20 =
                            [::alloc::__export::must_use({
                                                ::alloc::fmt::format(format_args!("const "))
                                            })].into_iter();
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("you might have meant to write a const parameter here")),
                                &sub_args);
                        diag.span_suggestions_with_style(__binding_0, __message,
                            __code_20, __binding_1,
                            rustc_errors::SuggestionStyle::ShowAlways);
                    }
                }
            }
        }
    };Subdiagnostic)]
878#[suggestion(
879    "you might have meant to write a const parameter here",
880    code = "const ",
881    style = "verbose"
882)]
883pub(crate) struct UnexpectedResChangeTyToConstParamSugg {
884    #[primary_span]
885    pub span: Span,
886    #[applicability]
887    pub applicability: Applicability,
888}
889
890#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for UnexpectedMissingConstParameter {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    UnexpectedMissingConstParameter {
                        span: __binding_0,
                        snippet: __binding_1,
                        item_name: __binding_2,
                        item_location: __binding_3 } => {
                        let __code_21 =
                            [::alloc::__export::must_use({
                                                ::alloc::fmt::format(format_args!("{0}", __binding_1))
                                            })].into_iter();
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("snippet".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_1,
                                &mut diag.long_ty_path));
                        sub_args.insert("item_name".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_2,
                                &mut diag.long_ty_path));
                        sub_args.insert("item_location".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_3,
                                &mut diag.long_ty_path));
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("you might have meant to introduce a const parameter `{$item_name}` on the {$item_location}")),
                                &sub_args);
                        diag.span_suggestions_with_style(__binding_0, __message,
                            __code_21, rustc_errors::Applicability::MachineApplicable,
                            rustc_errors::SuggestionStyle::ShowAlways);
                    }
                }
            }
        }
    };Subdiagnostic)]
891#[suggestion(
892    "you might have meant to introduce a const parameter `{$item_name}` on the {$item_location}",
893    code = "{snippet}",
894    applicability = "machine-applicable",
895    style = "verbose"
896)]
897pub(crate) struct UnexpectedMissingConstParameter {
898    #[primary_span]
899    pub span: Span,
900    pub snippet: String,
901    pub item_name: String,
902    pub item_location: String,
903}
904
905#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for
            UnexpectedResChangeTyParamToConstParamSugg {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    UnexpectedResChangeTyParamToConstParamSugg {
                        before: __binding_0, after: __binding_1 } => {
                        let mut suggestions = Vec::new();
                        let __code_22 =
                            ::alloc::__export::must_use({
                                    ::alloc::fmt::format(format_args!("const "))
                                });
                        let __code_23 =
                            ::alloc::__export::must_use({
                                    ::alloc::fmt::format(format_args!(": /* Type */"))
                                });
                        suggestions.push((__binding_0, __code_22));
                        suggestions.push((__binding_1, __code_23));
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("you might have meant to write a const parameter here")),
                                &sub_args);
                        diag.multipart_suggestion_with_style(__message, suggestions,
                            rustc_errors::Applicability::HasPlaceholders,
                            rustc_errors::SuggestionStyle::ShowAlways);
                    }
                }
            }
        }
    };Subdiagnostic)]
906#[multipart_suggestion(
907    "you might have meant to write a const parameter here",
908    applicability = "has-placeholders",
909    style = "verbose"
910)]
911pub(crate) struct UnexpectedResChangeTyParamToConstParamSugg {
912    #[suggestion_part(code = "const ")]
913    pub before: Span,
914    #[suggestion_part(code = ": /* Type */")]
915    pub after: Span,
916}
917
918#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for
            UnexpectedResUseAtOpInSlicePatWithRangeSugg {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    UnexpectedResUseAtOpInSlicePatWithRangeSugg {
                        span: __binding_0, ident: __binding_1, snippet: __binding_2
                        } => {
                        let __code_24 =
                            [::alloc::__export::must_use({
                                                ::alloc::fmt::format(format_args!("{0}", __binding_2))
                                            })].into_iter();
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("ident".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_1,
                                &mut diag.long_ty_path));
                        sub_args.insert("snippet".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_2,
                                &mut diag.long_ty_path));
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("if you meant to collect the rest of the slice in `{$ident}`, use the at operator")),
                                &sub_args);
                        diag.span_suggestions_with_style(__binding_0, __message,
                            __code_24, rustc_errors::Applicability::MaybeIncorrect,
                            rustc_errors::SuggestionStyle::ShowAlways);
                    }
                }
            }
        }
    };Subdiagnostic)]
919#[suggestion(
920    "if you meant to collect the rest of the slice in `{$ident}`, use the at operator",
921    code = "{snippet}",
922    applicability = "maybe-incorrect",
923    style = "verbose"
924)]
925pub(crate) struct UnexpectedResUseAtOpInSlicePatWithRangeSugg {
926    #[primary_span]
927    pub span: Span,
928    pub ident: Ident,
929    pub snippet: String,
930}
931
932#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            ExternCrateLoadingMacroNotAtCrateRoot 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 {
                    ExternCrateLoadingMacroNotAtCrateRoot { span: __binding_0 }
                        => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("an `extern crate` loading macros must be at the crate root")));
                        diag.code(E0468);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
933#[diag("an `extern crate` loading macros must be at the crate root", code = E0468)]
934pub(crate) struct ExternCrateLoadingMacroNotAtCrateRoot {
935    #[primary_span]
936    pub(crate) span: Span,
937}
938
939#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            ExternCrateSelfRequiresRenaming 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 {
                    ExternCrateSelfRequiresRenaming { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`extern crate self;` requires renaming")));
                        let __code_25 =
                            [::alloc::__export::must_use({
                                                ::alloc::fmt::format(format_args!("extern crate self as name;"))
                                            })].into_iter();
                        ;
                        diag.span(__binding_0);
                        diag.span_suggestions_with_style(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("rename the `self` crate to be able to import it")),
                            __code_25, rustc_errors::Applicability::HasPlaceholders,
                            rustc_errors::SuggestionStyle::ShowCode);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
940#[diag("`extern crate self;` requires renaming")]
941pub(crate) struct ExternCrateSelfRequiresRenaming {
942    #[primary_span]
943    #[suggestion(
944        "rename the `self` crate to be able to import it",
945        code = "extern crate self as name;",
946        applicability = "has-placeholders"
947    )]
948    pub(crate) span: Span,
949}
950
951#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            MacroUseNameAlreadyInUse 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 {
                    MacroUseNameAlreadyInUse {
                        span: __binding_0, name: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`{$name}` is already in scope")));
                        diag.note(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("macro-expanded `#[macro_use]`s may not shadow existing macros (see RFC 1560)")));
                        ;
                        diag.arg("name", __binding_1);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
952#[diag("`{$name}` is already in scope")]
953#[note("macro-expanded `#[macro_use]`s may not shadow existing macros (see RFC 1560)")]
954pub(crate) struct MacroUseNameAlreadyInUse {
955    #[primary_span]
956    pub(crate) span: Span,
957    pub(crate) name: Symbol,
958}
959
960#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            ImportedMacroNotFound 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 {
                    ImportedMacroNotFound { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("imported macro not found")));
                        diag.code(E0469);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
961#[diag("imported macro not found", code = E0469)]
962pub(crate) struct ImportedMacroNotFound {
963    #[primary_span]
964    pub(crate) span: Span,
965}
966
967#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            MacroExternDeprecated 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 {
                    MacroExternDeprecated {
                        span: __binding_0, inner_attribute: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`#[macro_escape]` is a deprecated synonym for `#[macro_use]`")));
                        ;
                        diag.span(__binding_0);
                        if __binding_1 {
                            diag.help(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("try an outer attribute: `#[macro_use]`")));
                        }
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
968#[diag("`#[macro_escape]` is a deprecated synonym for `#[macro_use]`")]
969pub(crate) struct MacroExternDeprecated {
970    #[primary_span]
971    pub(crate) span: Span,
972    #[help("try an outer attribute: `#[macro_use]`")]
973    pub inner_attribute: bool,
974}
975
976#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            ArgumentsMacroUseNotAllowed 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 {
                    ArgumentsMacroUseNotAllowed { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("arguments to `macro_use` are not allowed here")));
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
977#[diag("arguments to `macro_use` are not allowed here")]
978pub(crate) struct ArgumentsMacroUseNotAllowed {
979    #[primary_span]
980    pub(crate) span: Span,
981}
982
983#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for UnnamedImportSugg {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    UnnamedImportSugg { span: __binding_0, ident: __binding_1 }
                        => {
                        let mut suggestions = Vec::new();
                        let __code_26 =
                            ::alloc::__export::must_use({
                                    ::alloc::fmt::format(format_args!("{0} as name",
                                            __binding_1))
                                });
                        suggestions.push((__binding_0, __code_26));
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("ident".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_1,
                                &mut diag.long_ty_path));
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("try renaming it with a name")),
                                &sub_args);
                        diag.multipart_suggestion_with_style(__message, suggestions,
                            rustc_errors::Applicability::MaybeIncorrect,
                            rustc_errors::SuggestionStyle::ShowAlways);
                    }
                }
            }
        }
    };Subdiagnostic)]
984#[multipart_suggestion(
985    "try renaming it with a name",
986    applicability = "maybe-incorrect",
987    style = "verbose"
988)]
989pub(crate) struct UnnamedImportSugg {
990    #[suggestion_part(code = "{ident} as name")]
991    pub(crate) span: Span,
992    pub(crate) ident: Ident,
993}
994
995#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for UnnamedImport
            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 {
                    UnnamedImport { span: __binding_0, sugg: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("imports need to be explicitly named")));
                        ;
                        diag.span(__binding_0);
                        if let Some(__binding_1) = __binding_1 {
                            diag.subdiagnostic(__binding_1);
                        }
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
996#[diag("imports need to be explicitly named")]
997pub(crate) struct UnnamedImport {
998    #[primary_span]
999    pub(crate) span: Span,
1000    #[subdiagnostic]
1001    pub(crate) sugg: Option<UnnamedImportSugg>,
1002}
1003
1004#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            MacroExpandedExternCrateCannotShadowExternArguments 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 {
                    MacroExpandedExternCrateCannotShadowExternArguments {
                        span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("macro-expanded `extern crate` items cannot shadow names passed with `--extern`")));
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1005#[diag("macro-expanded `extern crate` items cannot shadow names passed with `--extern`")]
1006pub(crate) struct MacroExpandedExternCrateCannotShadowExternArguments {
1007    #[primary_span]
1008    pub(crate) span: Span,
1009}
1010
1011#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            ElidedAnonymousLifetimeReportError 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 {
                    ElidedAnonymousLifetimeReportError {
                        span: __binding_0, suggestion: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`&` without an explicit lifetime name cannot be used here")));
                        diag.code(E0637);
                        ;
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("explicit lifetime name needed here")));
                        if let Some(__binding_1) = __binding_1 {
                            diag.subdiagnostic(__binding_1);
                        }
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1012#[diag("`&` without an explicit lifetime name cannot be used here", code = E0637)]
1013pub(crate) struct ElidedAnonymousLifetimeReportError {
1014    #[primary_span]
1015    #[label("explicit lifetime name needed here")]
1016    pub(crate) span: Span,
1017    #[subdiagnostic]
1018    pub(crate) suggestion: Option<ElidedAnonymousLifetimeReportErrorSuggestion>,
1019}
1020
1021#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            LendingIteratorReportError 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 {
                    LendingIteratorReportError {
                        lifetime: __binding_0, ty: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("associated type `Iterator::Item` is declared without lifetime parameters, so using a borrowed type for them requires that lifetime to come from the implemented type")));
                        ;
                        diag.span(__binding_0);
                        diag.span_note(__binding_1,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("you can't create an `Iterator` that borrows each `Item` from itself, but you can instead create a new type that borrows your existing type and implement `Iterator` for that new type")));
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1022#[diag(
1023    "associated type `Iterator::Item` is declared without lifetime parameters, so using a borrowed type for them requires that lifetime to come from the implemented type"
1024)]
1025pub(crate) struct LendingIteratorReportError {
1026    #[primary_span]
1027    pub(crate) lifetime: Span,
1028    #[note(
1029        "you can't create an `Iterator` that borrows each `Item` from itself, but you can instead create a new type that borrows your existing type and implement `Iterator` for that new type"
1030    )]
1031    pub(crate) ty: Span,
1032}
1033
1034#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            AnonymousLifetimeNonGatReportError 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 {
                    AnonymousLifetimeNonGatReportError {
                        lifetime: __binding_0, decl: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("missing lifetime in associated type")));
                        ;
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("this lifetime must come from the implemented type")));
                        diag.span_note(__binding_1,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("in the trait the associated type is declared without lifetime parameters, so using a borrowed type for them requires that lifetime to come from the implemented type")));
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1035#[diag("missing lifetime in associated type")]
1036pub(crate) struct AnonymousLifetimeNonGatReportError {
1037    #[primary_span]
1038    #[label("this lifetime must come from the implemented type")]
1039    pub(crate) lifetime: Span,
1040    #[note(
1041        "in the trait the associated type is declared without lifetime parameters, so using a borrowed type for them requires that lifetime to come from the implemented type"
1042    )]
1043    pub(crate) decl: MultiSpan,
1044}
1045
1046#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for
            ElidedAnonymousLifetimeReportErrorSuggestion {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    ElidedAnonymousLifetimeReportErrorSuggestion {
                        lo: __binding_0, hi: __binding_1 } => {
                        let mut suggestions = Vec::new();
                        let __code_27 =
                            ::alloc::__export::must_use({
                                    ::alloc::fmt::format(format_args!("for<\'a> "))
                                });
                        let __code_28 =
                            ::alloc::__export::must_use({
                                    ::alloc::fmt::format(format_args!("\'a "))
                                });
                        suggestions.push((__binding_0, __code_27));
                        suggestions.push((__binding_1, __code_28));
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("consider introducing a higher-ranked lifetime here")),
                                &sub_args);
                        diag.multipart_suggestion_with_style(__message, suggestions,
                            rustc_errors::Applicability::MachineApplicable,
                            rustc_errors::SuggestionStyle::ShowCode);
                    }
                }
            }
        }
    };Subdiagnostic)]
1047#[multipart_suggestion(
1048    "consider introducing a higher-ranked lifetime here",
1049    applicability = "machine-applicable"
1050)]
1051pub(crate) struct ElidedAnonymousLifetimeReportErrorSuggestion {
1052    #[suggestion_part(code = "for<'a> ")]
1053    pub(crate) lo: Span,
1054    #[suggestion_part(code = "'a ")]
1055    pub(crate) hi: Span,
1056}
1057
1058#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            ExplicitAnonymousLifetimeReportError 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 {
                    ExplicitAnonymousLifetimeReportError { span: __binding_0 }
                        => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`'_` cannot be used here")));
                        diag.code(E0637);
                        ;
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`'_` is a reserved lifetime name")));
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1059#[diag("`'_` cannot be used here", code = E0637)]
1060pub(crate) struct ExplicitAnonymousLifetimeReportError {
1061    #[primary_span]
1062    #[label("`'_` is a reserved lifetime name")]
1063    pub(crate) span: Span,
1064}
1065
1066#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            ImplicitElidedLifetimeNotAllowedHere 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 {
                    ImplicitElidedLifetimeNotAllowedHere {
                        span: __binding_0, subdiag: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("implicit elided lifetime not allowed here")));
                        diag.code(E0726);
                        ;
                        diag.span(__binding_0);
                        diag.subdiagnostic(__binding_1);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1067#[diag("implicit elided lifetime not allowed here", code = E0726)]
1068pub(crate) struct ImplicitElidedLifetimeNotAllowedHere {
1069    #[primary_span]
1070    pub(crate) span: Span,
1071    #[subdiagnostic]
1072    pub(crate) subdiag: ElidedLifetimeInPathSubdiag,
1073}
1074
1075#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            UnderscoreLifetimeIsReserved 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 {
                    UnderscoreLifetimeIsReserved { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`'_` cannot be used here")));
                        diag.code(E0637);
                        diag.help(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("use another lifetime specifier")));
                        ;
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`'_` is a reserved lifetime name")));
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1076#[diag("`'_` cannot be used here", code = E0637)]
1077#[help("use another lifetime specifier")]
1078pub(crate) struct UnderscoreLifetimeIsReserved {
1079    #[primary_span]
1080    #[label("`'_` is a reserved lifetime name")]
1081    pub(crate) span: Span,
1082}
1083
1084#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            StaticLifetimeIsReserved 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 {
                    StaticLifetimeIsReserved {
                        span: __binding_0, lifetime: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("invalid lifetime parameter name: `{$lifetime}`")));
                        diag.code(E0262);
                        ;
                        diag.arg("lifetime", __binding_1);
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("'static is a reserved lifetime name")));
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1085#[diag("invalid lifetime parameter name: `{$lifetime}`", code = E0262)]
1086pub(crate) struct StaticLifetimeIsReserved {
1087    #[primary_span]
1088    #[label("'static is a reserved lifetime name")]
1089    pub(crate) span: Span,
1090    pub(crate) lifetime: Ident,
1091}
1092
1093#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            VariableIsNotBoundInAllPatterns 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 {
                    VariableIsNotBoundInAllPatterns {
                        multispan: __binding_0, name: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("variable `{$name}` is not bound in all patterns")));
                        diag.code(E0408);
                        ;
                        diag.arg("name", __binding_1);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1094#[diag("variable `{$name}` is not bound in all patterns", code = E0408)]
1095pub(crate) struct VariableIsNotBoundInAllPatterns {
1096    #[primary_span]
1097    pub(crate) multispan: MultiSpan,
1098    pub(crate) name: Ident,
1099}
1100
1101#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for PatternDoesntBindName {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    PatternDoesntBindName { span: __binding_0, name: __binding_1
                        } => {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("name".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_1,
                                &mut diag.long_ty_path));
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("pattern doesn't bind `{$name}`")),
                                &sub_args);
                        diag.span_label(__binding_0, __message);
                    }
                }
            }
        }
    };Subdiagnostic, #[automatically_derived]
impl ::core::fmt::Debug for PatternDoesntBindName {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field2_finish(f,
            "PatternDoesntBindName", "span", &self.span, "name", &&self.name)
    }
}Debug, #[automatically_derived]
impl ::core::clone::Clone for PatternDoesntBindName {
    #[inline]
    fn clone(&self) -> PatternDoesntBindName {
        PatternDoesntBindName {
            span: ::core::clone::Clone::clone(&self.span),
            name: ::core::clone::Clone::clone(&self.name),
        }
    }
}Clone)]
1102#[label("pattern doesn't bind `{$name}`")]
1103pub(crate) struct PatternDoesntBindName {
1104    #[primary_span]
1105    pub(crate) span: Span,
1106    pub(crate) name: Ident,
1107}
1108
1109#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for VariableNotInAllPatterns {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    VariableNotInAllPatterns { span: __binding_0 } => {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("variable not in all patterns")),
                                &sub_args);
                        diag.span_label(__binding_0, __message);
                    }
                }
            }
        }
    };Subdiagnostic, #[automatically_derived]
impl ::core::fmt::Debug for VariableNotInAllPatterns {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field1_finish(f,
            "VariableNotInAllPatterns", "span", &&self.span)
    }
}Debug, #[automatically_derived]
impl ::core::clone::Clone for VariableNotInAllPatterns {
    #[inline]
    fn clone(&self) -> VariableNotInAllPatterns {
        VariableNotInAllPatterns {
            span: ::core::clone::Clone::clone(&self.span),
        }
    }
}Clone)]
1110#[label("variable not in all patterns")]
1111pub(crate) struct VariableNotInAllPatterns {
1112    #[primary_span]
1113    pub(crate) span: Span,
1114}
1115
1116#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for PatternBindingTypo {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    PatternBindingTypo { spans: __binding_0, typo: __binding_1 }
                        => {
                        let mut suggestions = Vec::new();
                        let __code_29 =
                            ::alloc::__export::must_use({
                                    ::alloc::fmt::format(format_args!("{0}", __binding_1))
                                });
                        for __binding_0 in __binding_0 {
                            suggestions.push((__binding_0, __code_29.clone()));
                        }
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("typo".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_1,
                                &mut diag.long_ty_path));
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("you might have meant to use the similarly named previously used binding `{$typo}`")),
                                &sub_args);
                        diag.multipart_suggestion_with_style(__message, suggestions,
                            rustc_errors::Applicability::MaybeIncorrect,
                            rustc_errors::SuggestionStyle::ShowAlways);
                    }
                }
            }
        }
    };Subdiagnostic)]
1117#[multipart_suggestion(
1118    "you might have meant to use the similarly named previously used binding `{$typo}`",
1119    applicability = "maybe-incorrect",
1120    style = "verbose"
1121)]
1122pub(crate) struct PatternBindingTypo {
1123    #[suggestion_part(code = "{typo}")]
1124    pub(crate) spans: Vec<Span>,
1125    pub(crate) typo: Symbol,
1126}
1127
1128#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            NameDefinedMultipleTime 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 {
                    NameDefinedMultipleTime {
                        span: __binding_0,
                        name: __binding_1,
                        descr: __binding_2,
                        container: __binding_3,
                        label: __binding_4,
                        old_binding_label: __binding_5 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the name `{$name}` is defined multiple times")));
                        diag.note(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`{$name}` must be defined only once in the {$descr} namespace of this {$container}")));
                        ;
                        diag.arg("name", __binding_1);
                        diag.arg("descr", __binding_2);
                        diag.arg("container", __binding_3);
                        diag.span(__binding_0);
                        diag.subdiagnostic(__binding_4);
                        if let Some(__binding_5) = __binding_5 {
                            diag.subdiagnostic(__binding_5);
                        }
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1129#[diag("the name `{$name}` is defined multiple times")]
1130#[note("`{$name}` must be defined only once in the {$descr} namespace of this {$container}")]
1131pub(crate) struct NameDefinedMultipleTime {
1132    #[primary_span]
1133    pub(crate) span: Span,
1134    pub(crate) name: Symbol,
1135    pub(crate) descr: &'static str,
1136    pub(crate) container: &'static str,
1137    #[subdiagnostic]
1138    pub(crate) label: NameDefinedMultipleTimeLabel,
1139    #[subdiagnostic]
1140    pub(crate) old_binding_label: Option<NameDefinedMultipleTimeOldBindingLabel>,
1141}
1142
1143#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for NameDefinedMultipleTimeLabel {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    NameDefinedMultipleTimeLabel::Reimported {
                        span: __binding_0, name: __binding_1 } => {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("name".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_1,
                                &mut diag.long_ty_path));
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`{$name}` reimported here")),
                                &sub_args);
                        diag.span_label(__binding_0, __message);
                    }
                    NameDefinedMultipleTimeLabel::Redefined {
                        span: __binding_0, name: __binding_1 } => {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("name".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_1,
                                &mut diag.long_ty_path));
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`{$name}` redefined here")),
                                &sub_args);
                        diag.span_label(__binding_0, __message);
                    }
                }
            }
        }
    };Subdiagnostic)]
1144pub(crate) enum NameDefinedMultipleTimeLabel {
1145    #[label("`{$name}` reimported here")]
1146    Reimported {
1147        #[primary_span]
1148        span: Span,
1149        name: Symbol,
1150    },
1151    #[label("`{$name}` redefined here")]
1152    Redefined {
1153        #[primary_span]
1154        span: Span,
1155        name: Symbol,
1156    },
1157}
1158
1159#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for
            NameDefinedMultipleTimeOldBindingLabel {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    NameDefinedMultipleTimeOldBindingLabel::Import {
                        span: __binding_0, old_kind: __binding_1, name: __binding_2
                        } => {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("old_kind".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_1,
                                &mut diag.long_ty_path));
                        sub_args.insert("name".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_2,
                                &mut diag.long_ty_path));
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("previous import of the {$old_kind} `{$name}` here")),
                                &sub_args);
                        diag.span_label(__binding_0, __message);
                    }
                    NameDefinedMultipleTimeOldBindingLabel::Definition {
                        span: __binding_0, old_kind: __binding_1, name: __binding_2
                        } => {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("old_kind".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_1,
                                &mut diag.long_ty_path));
                        sub_args.insert("name".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_2,
                                &mut diag.long_ty_path));
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("previous definition of the {$old_kind} `{$name}` here")),
                                &sub_args);
                        diag.span_label(__binding_0, __message);
                    }
                }
            }
        }
    };Subdiagnostic)]
1160pub(crate) enum NameDefinedMultipleTimeOldBindingLabel {
1161    #[label("previous import of the {$old_kind} `{$name}` here")]
1162    Import {
1163        #[primary_span]
1164        span: Span,
1165        old_kind: &'static str,
1166        name: Symbol,
1167    },
1168    #[label("previous definition of the {$old_kind} `{$name}` here")]
1169    Definition {
1170        #[primary_span]
1171        span: Span,
1172        old_kind: &'static str,
1173        name: Symbol,
1174    },
1175}
1176
1177#[derive(const _: () =
    {
        impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
            IsPrivate<'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 {
                    IsPrivate {
                        span: __binding_0,
                        ident_descr: __binding_1,
                        ident: __binding_2 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("{$ident_descr} `{$ident}` is private")));
                        diag.code(E0603);
                        ;
                        diag.arg("ident_descr", __binding_1);
                        diag.arg("ident", __binding_2);
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("private {$ident_descr}")));
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1178#[diag("{$ident_descr} `{$ident}` is private", code = E0603)]
1179pub(crate) struct IsPrivate<'a> {
1180    #[primary_span]
1181    #[label("private {$ident_descr}")]
1182    pub(crate) span: Span,
1183    pub(crate) ident_descr: &'a str,
1184    pub(crate) ident: Ident,
1185}
1186
1187#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            GenericArgumentsInMacroPath 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 {
                    GenericArgumentsInMacroPath { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("generic arguments in macro path")));
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1188#[diag("generic arguments in macro path")]
1189pub(crate) struct GenericArgumentsInMacroPath {
1190    #[primary_span]
1191    pub(crate) span: Span,
1192}
1193
1194#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            AttributesStartingWithRustcAreReserved 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 {
                    AttributesStartingWithRustcAreReserved { span: __binding_0 }
                        => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("attributes starting with `rustc` are reserved for use by the `rustc` compiler")));
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1195#[diag("attributes starting with `rustc` are reserved for use by the `rustc` compiler")]
1196pub(crate) struct AttributesStartingWithRustcAreReserved {
1197    #[primary_span]
1198    pub(crate) span: Span,
1199}
1200
1201#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            CannotUseThroughAnImport 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 {
                    CannotUseThroughAnImport {
                        span: __binding_0,
                        article: __binding_1,
                        descr: __binding_2,
                        binding_span: __binding_3 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("cannot use {$article} {$descr} through an import")));
                        ;
                        diag.arg("article", __binding_1);
                        diag.arg("descr", __binding_2);
                        diag.span(__binding_0);
                        if let Some(__binding_3) = __binding_3 {
                            diag.span_note(__binding_3,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the {$descr} imported here")));
                        }
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1202#[diag("cannot use {$article} {$descr} through an import")]
1203pub(crate) struct CannotUseThroughAnImport {
1204    #[primary_span]
1205    pub(crate) span: Span,
1206    pub(crate) article: &'static str,
1207    pub(crate) descr: &'static str,
1208    #[note("the {$descr} imported here")]
1209    pub(crate) binding_span: Option<Span>,
1210}
1211
1212#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            NameReservedInAttributeNamespace 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 {
                    NameReservedInAttributeNamespace {
                        span: __binding_0, ident: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("name `{$ident}` is reserved in attribute namespace")));
                        ;
                        diag.arg("ident", __binding_1);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1213#[diag("name `{$ident}` is reserved in attribute namespace")]
1214pub(crate) struct NameReservedInAttributeNamespace {
1215    #[primary_span]
1216    pub(crate) span: Span,
1217    pub(crate) ident: Symbol,
1218}
1219
1220#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            CannotFindBuiltinMacroWithName 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 {
                    CannotFindBuiltinMacroWithName {
                        span: __binding_0, ident: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("cannot find a built-in macro with name `{$ident}`")));
                        ;
                        diag.arg("ident", __binding_1);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1221#[diag("cannot find a built-in macro with name `{$ident}`")]
1222pub(crate) struct CannotFindBuiltinMacroWithName {
1223    #[primary_span]
1224    pub(crate) span: Span,
1225    pub(crate) ident: Ident,
1226}
1227
1228#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            ToolWasAlreadyRegistered 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 {
                    ToolWasAlreadyRegistered {
                        span: __binding_0,
                        tool: __binding_1,
                        old_ident_span: __binding_2 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("tool `{$tool}` was already registered")));
                        ;
                        diag.arg("tool", __binding_1);
                        diag.span(__binding_0);
                        diag.span_label(__binding_2,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("already registered here")));
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1229#[diag("tool `{$tool}` was already registered")]
1230pub(crate) struct ToolWasAlreadyRegistered {
1231    #[primary_span]
1232    pub(crate) span: Span,
1233    pub(crate) tool: Ident,
1234    #[label("already registered here")]
1235    pub(crate) old_ident_span: Span,
1236}
1237
1238#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for DefinedHere {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    DefinedHere::SimilarlyNamed {
                        span: __binding_0,
                        candidate_descr: __binding_1,
                        candidate: __binding_2 } => {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("candidate_descr".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_1,
                                &mut diag.long_ty_path));
                        sub_args.insert("candidate".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_2,
                                &mut diag.long_ty_path));
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("similarly named {$candidate_descr} `{$candidate}` defined here")),
                                &sub_args);
                        diag.span_label(__binding_0, __message);
                    }
                    DefinedHere::SingleItem {
                        span: __binding_0,
                        candidate_descr: __binding_1,
                        candidate: __binding_2 } => {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("candidate_descr".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_1,
                                &mut diag.long_ty_path));
                        sub_args.insert("candidate".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_2,
                                &mut diag.long_ty_path));
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("{$candidate_descr} `{$candidate}` defined here")),
                                &sub_args);
                        diag.span_label(__binding_0, __message);
                    }
                }
            }
        }
    };Subdiagnostic)]
1239pub(crate) enum DefinedHere {
1240    #[label("similarly named {$candidate_descr} `{$candidate}` defined here")]
1241    SimilarlyNamed {
1242        #[primary_span]
1243        span: Span,
1244        candidate_descr: &'static str,
1245        candidate: Symbol,
1246    },
1247    #[label("{$candidate_descr} `{$candidate}` defined here")]
1248    SingleItem {
1249        #[primary_span]
1250        span: Span,
1251        candidate_descr: &'static str,
1252        candidate: Symbol,
1253    },
1254}
1255
1256#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for OuterIdentIsNotPubliclyReexported
            {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    OuterIdentIsNotPubliclyReexported {
                        span: __binding_0,
                        outer_ident_descr: __binding_1,
                        outer_ident: __binding_2 } => {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("outer_ident_descr".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_1,
                                &mut diag.long_ty_path));
                        sub_args.insert("outer_ident".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_2,
                                &mut diag.long_ty_path));
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("{$outer_ident_descr} `{$outer_ident}` is not publicly re-exported")),
                                &sub_args);
                        diag.span_label(__binding_0, __message);
                    }
                }
            }
        }
    };Subdiagnostic)]
1257#[label("{$outer_ident_descr} `{$outer_ident}` is not publicly re-exported")]
1258pub(crate) struct OuterIdentIsNotPubliclyReexported {
1259    #[primary_span]
1260    pub(crate) span: Span,
1261    pub(crate) outer_ident_descr: &'static str,
1262    pub(crate) outer_ident: Ident,
1263}
1264
1265#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for
            ConstructorPrivateIfAnyFieldPrivate {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    ConstructorPrivateIfAnyFieldPrivate { span: __binding_0 } =>
                        {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("a constructor is private if any of the fields is private")),
                                &sub_args);
                        diag.span_label(__binding_0, __message);
                    }
                }
            }
        }
    };Subdiagnostic)]
1266#[label("a constructor is private if any of the fields is private")]
1267pub(crate) struct ConstructorPrivateIfAnyFieldPrivate {
1268    #[primary_span]
1269    pub(crate) span: Span,
1270}
1271
1272#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for ConsiderMakingTheFieldPublic {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    ConsiderMakingTheFieldPublic {
                        spans: __binding_0, number_of_fields: __binding_1 } => {
                        let mut suggestions = Vec::new();
                        let __code_30 =
                            ::alloc::__export::must_use({
                                    ::alloc::fmt::format(format_args!("pub "))
                                });
                        for __binding_0 in __binding_0 {
                            suggestions.push((__binding_0, __code_30.clone()));
                        }
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("number_of_fields".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_1,
                                &mut diag.long_ty_path));
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("{ $number_of_fields ->\n        [one] consider making the field publicly accessible\n        *[other] consider making the fields publicly accessible\n    }")),
                                &sub_args);
                        diag.multipart_suggestion_with_style(__message, suggestions,
                            rustc_errors::Applicability::MaybeIncorrect,
                            rustc_errors::SuggestionStyle::ShowAlways);
                    }
                }
            }
        }
    };Subdiagnostic)]
1273#[multipart_suggestion(
1274    "{ $number_of_fields ->
1275        [one] consider making the field publicly accessible
1276        *[other] consider making the fields publicly accessible
1277    }",
1278    applicability = "maybe-incorrect",
1279    style = "verbose"
1280)]
1281pub(crate) struct ConsiderMakingTheFieldPublic {
1282    #[suggestion_part(code = "pub ")]
1283    pub(crate) spans: Vec<Span>,
1284    pub(crate) number_of_fields: usize,
1285}
1286
1287#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for ImportIdent {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    ImportIdent::ThroughReExport {
                        span: __binding_0, ident: __binding_1, path: __binding_2 }
                        => {
                        let __code_31 =
                            [::alloc::__export::must_use({
                                                ::alloc::fmt::format(format_args!("{0}", __binding_2))
                                            })].into_iter();
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("ident".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_1,
                                &mut diag.long_ty_path));
                        sub_args.insert("path".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_2,
                                &mut diag.long_ty_path));
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("import `{$ident}` through the re-export")),
                                &sub_args);
                        diag.span_suggestions_with_style(__binding_0, __message,
                            __code_31, rustc_errors::Applicability::MachineApplicable,
                            rustc_errors::SuggestionStyle::ShowAlways);
                    }
                    ImportIdent::Directly {
                        span: __binding_0, ident: __binding_1, path: __binding_2 }
                        => {
                        let __code_32 =
                            [::alloc::__export::must_use({
                                                ::alloc::fmt::format(format_args!("{0}", __binding_2))
                                            })].into_iter();
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("ident".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_1,
                                &mut diag.long_ty_path));
                        sub_args.insert("path".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_2,
                                &mut diag.long_ty_path));
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("import `{$ident}` directly")),
                                &sub_args);
                        diag.span_suggestions_with_style(__binding_0, __message,
                            __code_32, rustc_errors::Applicability::MachineApplicable,
                            rustc_errors::SuggestionStyle::ShowAlways);
                    }
                }
            }
        }
    };Subdiagnostic)]
1288pub(crate) enum ImportIdent {
1289    #[suggestion(
1290        "import `{$ident}` through the re-export",
1291        code = "{path}",
1292        applicability = "machine-applicable",
1293        style = "verbose"
1294    )]
1295    ThroughReExport {
1296        #[primary_span]
1297        span: Span,
1298        ident: Ident,
1299        path: String,
1300    },
1301    #[suggestion(
1302        "import `{$ident}` directly",
1303        code = "{path}",
1304        applicability = "machine-applicable",
1305        style = "verbose"
1306    )]
1307    Directly {
1308        #[primary_span]
1309        span: Span,
1310        ident: Ident,
1311        path: String,
1312    },
1313}
1314
1315#[derive(const _: () =
    {
        impl<'a> rustc_errors::Subdiagnostic for
            NoteAndRefersToTheItemDefinedHere<'a> {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    NoteAndRefersToTheItemDefinedHere {
                        span: __binding_0,
                        binding_descr: __binding_1,
                        binding_name: __binding_2,
                        first: __binding_3,
                        dots: __binding_4 } => {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("binding_descr".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_1,
                                &mut diag.long_ty_path));
                        sub_args.insert("binding_name".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_2,
                                &mut diag.long_ty_path));
                        sub_args.insert("first".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_3,
                                &mut diag.long_ty_path));
                        sub_args.insert("dots".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_4,
                                &mut diag.long_ty_path));
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("{$first ->\n        [true] {$dots ->\n            [true] the {$binding_descr} `{$binding_name}` is defined here...\n            *[false] the {$binding_descr} `{$binding_name}` is defined here\n        }\n        *[false] {$dots ->\n            [true] ...and refers to the {$binding_descr} `{$binding_name}` which is defined here...\n            *[false] ...and refers to the {$binding_descr} `{$binding_name}` which is defined here\n        }\n    }")),
                                &sub_args);
                        diag.span_note(__binding_0, __message);
                    }
                }
            }
        }
    };Subdiagnostic)]
1316#[note(
1317    "{$first ->
1318        [true] {$dots ->
1319            [true] the {$binding_descr} `{$binding_name}` is defined here...
1320            *[false] the {$binding_descr} `{$binding_name}` is defined here
1321        }
1322        *[false] {$dots ->
1323            [true] ...and refers to the {$binding_descr} `{$binding_name}` which is defined here...
1324            *[false] ...and refers to the {$binding_descr} `{$binding_name}` which is defined here
1325        }
1326    }"
1327)]
1328pub(crate) struct NoteAndRefersToTheItemDefinedHere<'a> {
1329    #[primary_span]
1330    pub(crate) span: MultiSpan,
1331    pub(crate) binding_descr: &'a str,
1332    pub(crate) binding_name: Ident,
1333    pub(crate) first: bool,
1334    pub(crate) dots: bool,
1335}
1336
1337#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for RemoveUnnecessaryImport {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    RemoveUnnecessaryImport { span: __binding_0 } => {
                        let __code_33 =
                            [::alloc::__export::must_use({
                                                ::alloc::fmt::format(format_args!(""))
                                            })].into_iter();
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("remove unnecessary import")),
                                &sub_args);
                        diag.span_suggestions_with_style(__binding_0, __message,
                            __code_33, rustc_errors::Applicability::MaybeIncorrect,
                            rustc_errors::SuggestionStyle::ShowCode);
                    }
                }
            }
        }
    };Subdiagnostic)]
1338#[suggestion("remove unnecessary import", code = "", applicability = "maybe-incorrect")]
1339pub(crate) struct RemoveUnnecessaryImport {
1340    #[primary_span]
1341    pub(crate) span: Span,
1342}
1343
1344#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for ToolOnlyRemoveUnnecessaryImport {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    ToolOnlyRemoveUnnecessaryImport { span: __binding_0 } => {
                        let __code_34 =
                            [::alloc::__export::must_use({
                                                ::alloc::fmt::format(format_args!(""))
                                            })].into_iter();
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("remove unnecessary import")),
                                &sub_args);
                        diag.span_suggestions_with_style(__binding_0, __message,
                            __code_34, rustc_errors::Applicability::MaybeIncorrect,
                            rustc_errors::SuggestionStyle::CompletelyHidden);
                    }
                }
            }
        }
    };Subdiagnostic)]
1345#[suggestion(
1346    "remove unnecessary import",
1347    code = "",
1348    applicability = "maybe-incorrect",
1349    style = "tool-only"
1350)]
1351pub(crate) struct ToolOnlyRemoveUnnecessaryImport {
1352    #[primary_span]
1353    pub(crate) span: Span,
1354}
1355
1356#[derive(const _: () =
    {
        impl<'a> rustc_errors::Subdiagnostic for
            IdentImporterHereButItIsDesc<'a> {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    IdentImporterHereButItIsDesc {
                        span: __binding_0,
                        imported_ident: __binding_1,
                        imported_ident_desc: __binding_2 } => {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("imported_ident".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_1,
                                &mut diag.long_ty_path));
                        sub_args.insert("imported_ident_desc".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_2,
                                &mut diag.long_ty_path));
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`{$imported_ident}` is imported here, but it is {$imported_ident_desc}")),
                                &sub_args);
                        diag.span_note(__binding_0, __message);
                    }
                }
            }
        }
    };Subdiagnostic)]
1357#[note("`{$imported_ident}` is imported here, but it is {$imported_ident_desc}")]
1358pub(crate) struct IdentImporterHereButItIsDesc<'a> {
1359    #[primary_span]
1360    pub(crate) span: Span,
1361    pub(crate) imported_ident: Ident,
1362    pub(crate) imported_ident_desc: &'a str,
1363}
1364
1365#[derive(const _: () =
    {
        impl<'a> rustc_errors::Subdiagnostic for IdentInScopeButItIsDesc<'a> {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    IdentInScopeButItIsDesc {
                        imported_ident: __binding_0,
                        imported_ident_desc: __binding_1 } => {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("imported_ident".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_0,
                                &mut diag.long_ty_path));
                        sub_args.insert("imported_ident_desc".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_1,
                                &mut diag.long_ty_path));
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`{$imported_ident}` is in scope, but it is {$imported_ident_desc}")),
                                &sub_args);
                        diag.note(__message);
                    }
                }
            }
        }
    };Subdiagnostic)]
1366#[note("`{$imported_ident}` is in scope, but it is {$imported_ident_desc}")]
1367pub(crate) struct IdentInScopeButItIsDesc<'a> {
1368    pub(crate) imported_ident: Ident,
1369    pub(crate) imported_ident_desc: &'a str,
1370}
1371
1372pub(crate) struct FoundItemConfigureOut {
1373    pub(crate) span: Span,
1374    pub(crate) item_was: ItemWas,
1375}
1376
1377pub(crate) enum ItemWas {
1378    BehindFeature { feature: Symbol, span: Span },
1379    CfgOut { span: Span },
1380}
1381
1382impl Subdiagnostic for FoundItemConfigureOut {
1383    fn add_to_diag<G: EmissionGuarantee>(self, diag: &mut Diag<'_, G>) {
1384        let mut multispan: MultiSpan = self.span.into();
1385        match self.item_was {
1386            ItemWas::BehindFeature { feature, span } => {
1387                let value = feature.into_diag_arg(&mut None);
1388                let msg = rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the item is gated behind the `{$feature}` feature"))msg!("the item is gated behind the `{$feature}` feature")
1389                    .arg("feature", value)
1390                    .format();
1391                multispan.push_span_label(span, msg);
1392            }
1393            ItemWas::CfgOut { span } => {
1394                multispan.push_span_label(span, rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the item is gated here"))msg!("the item is gated here"));
1395            }
1396        }
1397        diag.span_note(multispan, rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("found an item that was configured out"))msg!("found an item that was configured out"));
1398    }
1399}
1400
1401#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            TraitImplMismatch 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 {
                    TraitImplMismatch {
                        span: __binding_0,
                        name: __binding_1,
                        kind: __binding_2,
                        trait_path: __binding_3,
                        trait_item_span: __binding_4 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("item `{$name}` is an associated {$kind}, which doesn't match its trait `{$trait_path}`")));
                        ;
                        diag.arg("name", __binding_1);
                        diag.arg("kind", __binding_2);
                        diag.arg("trait_path", __binding_3);
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("does not match trait")));
                        diag.span_label(__binding_4,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("item in trait")));
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1402#[diag("item `{$name}` is an associated {$kind}, which doesn't match its trait `{$trait_path}`")]
1403pub(crate) struct TraitImplMismatch {
1404    #[primary_span]
1405    #[label("does not match trait")]
1406    pub(crate) span: Span,
1407    pub(crate) name: Ident,
1408    pub(crate) kind: &'static str,
1409    pub(crate) trait_path: String,
1410    #[label("item in trait")]
1411    pub(crate) trait_item_span: Span,
1412}
1413
1414#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            LegacyDeriveHelpers 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 {
                    LegacyDeriveHelpers { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("derive helper attribute is used before it is introduced")));
                        ;
                        diag.span_label(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the attribute is introduced here")));
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1415#[diag("derive helper attribute is used before it is introduced")]
1416pub(crate) struct LegacyDeriveHelpers {
1417    #[label("the attribute is introduced here")]
1418    pub span: Span,
1419}
1420
1421#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            UnusedExternCrate 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 {
                    UnusedExternCrate {
                        span: __binding_0, removal_span: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("unused extern crate")));
                        let __code_35 =
                            [::alloc::__export::must_use({
                                                ::alloc::fmt::format(format_args!(""))
                                            })].into_iter();
                        ;
                        diag.span_label(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("unused")));
                        diag.span_suggestions_with_style(__binding_1,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("remove the unused `extern crate`")),
                            __code_35, rustc_errors::Applicability::MachineApplicable,
                            rustc_errors::SuggestionStyle::ShowAlways);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1422#[diag("unused extern crate")]
1423pub(crate) struct UnusedExternCrate {
1424    #[label("unused")]
1425    pub span: Span,
1426    #[suggestion(
1427        "remove the unused `extern crate`",
1428        code = "",
1429        applicability = "machine-applicable",
1430        style = "verbose"
1431    )]
1432    pub removal_span: Span,
1433}
1434
1435#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            ReexportPrivateDependency 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 {
                    ReexportPrivateDependency {
                        name: __binding_0, kind: __binding_1, krate: __binding_2 }
                        => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("{$kind} `{$name}` from private dependency '{$krate}' is re-exported")));
                        ;
                        diag.arg("name", __binding_0);
                        diag.arg("kind", __binding_1);
                        diag.arg("krate", __binding_2);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1436#[diag("{$kind} `{$name}` from private dependency '{$krate}' is re-exported")]
1437pub(crate) struct ReexportPrivateDependency {
1438    pub name: Symbol,
1439    pub kind: &'static str,
1440    pub krate: Symbol,
1441}
1442
1443#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for UnusedLabel
            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 {
                    UnusedLabel => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("unused label")));
                        ;
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1444#[diag("unused label")]
1445pub(crate) struct UnusedLabel;
1446
1447#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for UnusedMacroUse
            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 {
                    UnusedMacroUse => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("unused `#[macro_use]` import")));
                        ;
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1448#[diag("unused `#[macro_use]` import")]
1449pub(crate) struct UnusedMacroUse;
1450
1451#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            MacroUseDeprecated 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 {
                    MacroUseDeprecated => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("applying the `#[macro_use]` attribute to an `extern crate` item is deprecated")));
                        diag.help(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("remove it and import macros at use sites with a `use` item instead")));
                        ;
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1452#[diag("applying the `#[macro_use]` attribute to an `extern crate` item is deprecated")]
1453#[help("remove it and import macros at use sites with a `use` item instead")]
1454pub(crate) struct MacroUseDeprecated;
1455
1456#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for MacroIsPrivate
            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 {
                    MacroIsPrivate { ident: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("macro `{$ident}` is private")));
                        ;
                        diag.arg("ident", __binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1457#[diag("macro `{$ident}` is private")]
1458pub(crate) struct MacroIsPrivate {
1459    pub ident: Ident,
1460}
1461
1462#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            UnusedMacroDefinition 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 {
                    UnusedMacroDefinition { name: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("unused macro definition: `{$name}`")));
                        ;
                        diag.arg("name", __binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1463#[diag("unused macro definition: `{$name}`")]
1464pub(crate) struct UnusedMacroDefinition {
1465    pub name: Symbol,
1466}
1467
1468#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            MacroRuleNeverUsed 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 {
                    MacroRuleNeverUsed { n: __binding_0, name: __binding_1 } =>
                        {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("rule #{$n} of macro `{$name}` is never used")));
                        ;
                        diag.arg("n", __binding_0);
                        diag.arg("name", __binding_1);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1469#[diag("rule #{$n} of macro `{$name}` is never used")]
1470pub(crate) struct MacroRuleNeverUsed {
1471    pub n: usize,
1472    pub name: Symbol,
1473}
1474
1475#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            ExternCrateNotIdiomatic 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 {
                    ExternCrateNotIdiomatic {
                        span: __binding_0, code: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`extern crate` is not idiomatic in the new edition")));
                        let __code_36 =
                            [::alloc::__export::must_use({
                                                ::alloc::fmt::format(format_args!("{0}", __binding_1))
                                            })].into_iter();
                        ;
                        diag.arg("code", __binding_1);
                        diag.span_suggestions_with_style(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("convert it to a `use`")),
                            __code_36, rustc_errors::Applicability::MachineApplicable,
                            rustc_errors::SuggestionStyle::ShowAlways);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1476#[diag("`extern crate` is not idiomatic in the new edition")]
1477pub(crate) struct ExternCrateNotIdiomatic {
1478    #[suggestion(
1479        "convert it to a `use`",
1480        style = "verbose",
1481        code = "{code}",
1482        applicability = "machine-applicable"
1483    )]
1484    pub span: Span,
1485    pub code: &'static str,
1486}
1487
1488#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            OutOfScopeMacroCalls 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 {
                    OutOfScopeMacroCalls {
                        span: __binding_0, path: __binding_1, location: __binding_2
                        } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("cannot find macro `{$path}` in the current scope when looking from {$location}")));
                        diag.help(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("import `macro_rules` with `use` to make it callable above its definition")));
                        ;
                        diag.arg("path", __binding_1);
                        diag.arg("location", __binding_2);
                        diag.span_label(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("not found from {$location}")));
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1489#[diag("cannot find macro `{$path}` in the current scope when looking from {$location}")]
1490#[help("import `macro_rules` with `use` to make it callable above its definition")]
1491pub(crate) struct OutOfScopeMacroCalls {
1492    #[label("not found from {$location}")]
1493    pub span: Span,
1494    pub path: String,
1495    pub location: String,
1496}
1497
1498#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            RedundantImportVisibility 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 {
                    RedundantImportVisibility {
                        span: __binding_0,
                        help: __binding_1,
                        import_vis: __binding_2,
                        max_vis: __binding_3 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("glob import doesn't reexport anything with visibility `{$import_vis}` because no imported item is public enough")));
                        ;
                        diag.arg("import_vis", __binding_2);
                        diag.arg("max_vis", __binding_3);
                        diag.span_note(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the most public imported item is `{$max_vis}`")));
                        diag.help(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("reduce the glob import's visibility or increase visibility of imported items")));
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1499#[diag(
1500    "glob import doesn't reexport anything with visibility `{$import_vis}` because no imported item is public enough"
1501)]
1502pub(crate) struct RedundantImportVisibility {
1503    #[note("the most public imported item is `{$max_vis}`")]
1504    pub span: Span,
1505    #[help("reduce the glob import's visibility or increase visibility of imported items")]
1506    pub help: (),
1507    pub import_vis: String,
1508    pub max_vis: String,
1509}
1510
1511#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            UnknownDiagnosticAttribute 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 {
                    UnknownDiagnosticAttribute { typo: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("unknown diagnostic attribute")));
                        ;
                        if let Some(__binding_0) = __binding_0 {
                            diag.subdiagnostic(__binding_0);
                        }
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1512#[diag("unknown diagnostic attribute")]
1513pub(crate) struct UnknownDiagnosticAttribute {
1514    #[subdiagnostic]
1515    pub typo: Option<UnknownDiagnosticAttributeTypoSugg>,
1516}
1517
1518#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for
            UnknownDiagnosticAttributeTypoSugg {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    UnknownDiagnosticAttributeTypoSugg {
                        span: __binding_0, typo_name: __binding_1 } => {
                        let __code_37 =
                            [::alloc::__export::must_use({
                                                ::alloc::fmt::format(format_args!("{0}", __binding_1))
                                            })].into_iter();
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("typo_name".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_1,
                                &mut diag.long_ty_path));
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("an attribute with a similar name exists")),
                                &sub_args);
                        diag.span_suggestions_with_style(__binding_0, __message,
                            __code_37, rustc_errors::Applicability::MachineApplicable,
                            rustc_errors::SuggestionStyle::ShowAlways);
                    }
                }
            }
        }
    };Subdiagnostic)]
1519#[suggestion(
1520    "an attribute with a similar name exists",
1521    style = "verbose",
1522    code = "{typo_name}",
1523    applicability = "machine-applicable"
1524)]
1525pub(crate) struct UnknownDiagnosticAttributeTypoSugg {
1526    #[primary_span]
1527    pub span: Span,
1528    pub typo_name: Symbol,
1529}
1530
1531// FIXME: Make this properly translatable.
1532pub(crate) struct Ambiguity {
1533    pub ident: Ident,
1534    pub ambig_vis: Option<String>,
1535    pub kind: &'static str,
1536    pub help: Option<&'static [&'static str]>,
1537    pub b1_note: Spanned<String>,
1538    pub b1_help_msgs: Vec<String>,
1539    pub b2_note: Spanned<String>,
1540    pub b2_help_msgs: Vec<String>,
1541    /// If false, then it's a lint, if true, then it's an error with the `E0659` error code.
1542    pub is_error: bool,
1543}
1544
1545impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for Ambiguity {
1546    fn into_diag(self, dcx: DiagCtxtHandle<'a>, level: Level) -> Diag<'a, G> {
1547        let Self {
1548            ident,
1549            ambig_vis,
1550            kind,
1551            help,
1552            b1_note,
1553            b1_help_msgs,
1554            b2_note,
1555            b2_help_msgs,
1556            is_error,
1557        } = self;
1558
1559        let mut diag = Diag::new(dcx, level, "").with_span(ident.span);
1560        if is_error {
1561            diag.code(E0659);
1562        }
1563        if let Some(ambig_vis) = ambig_vis {
1564            diag.primary_message(::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("ambiguous import visibility: {0}",
                ambig_vis))
    })format!("ambiguous import visibility: {ambig_vis}"));
1565        } else {
1566            diag.primary_message(::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("`{0}` is ambiguous", ident))
    })format!("`{}` is ambiguous", ident));
1567            diag.span_label(ident.span, "ambiguous name");
1568        }
1569        diag.note(::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("ambiguous because of {0}", kind))
    })format!("ambiguous because of {}", kind));
1570        diag.span_note(b1_note.span, b1_note.node);
1571        if let Some(help) = help {
1572            for help in help {
1573                diag.help(*help);
1574            }
1575        }
1576        for help_msg in b1_help_msgs {
1577            diag.help(help_msg);
1578        }
1579        diag.span_note(b2_note.span, b2_note.node);
1580        for help_msg in b2_help_msgs {
1581            diag.help(help_msg);
1582        }
1583        diag
1584    }
1585}
1586
1587#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for UnusedLifetime
            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 {
                    UnusedLifetime {
                        deletion_span: __binding_0, ident: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("lifetime parameter `{$ident}` never used")));
                        let __code_38 =
                            [::alloc::__export::must_use({
                                                ::alloc::fmt::format(format_args!(""))
                                            })].into_iter();
                        ;
                        diag.arg("ident", __binding_1);
                        if let Some(__binding_0) = __binding_0 {
                            diag.span_suggestions_with_style(__binding_0,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("elide the unused lifetime")),
                                __code_38, rustc_errors::Applicability::MachineApplicable,
                                rustc_errors::SuggestionStyle::ShowCode);
                        }
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1588#[diag("lifetime parameter `{$ident}` never used")]
1589pub(crate) struct UnusedLifetime {
1590    #[suggestion("elide the unused lifetime", code = "", applicability = "machine-applicable")]
1591    pub deletion_span: Option<Span>,
1592
1593    pub ident: Ident,
1594}
1595
1596#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            AmbiguousGlobReexports 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 {
                    AmbiguousGlobReexports {
                        first_reexport: __binding_0,
                        duplicate_reexport: __binding_1,
                        name: __binding_2,
                        namespace: __binding_3 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("ambiguous glob re-exports")));
                        ;
                        diag.arg("name", __binding_2);
                        diag.arg("namespace", __binding_3);
                        diag.span_label(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the name `{$name}` in the {$namespace} namespace is first re-exported here")));
                        diag.span_label(__binding_1,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("but the name `{$name}` in the {$namespace} namespace is also re-exported here")));
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1597#[diag("ambiguous glob re-exports")]
1598pub(crate) struct AmbiguousGlobReexports {
1599    #[label("the name `{$name}` in the {$namespace} namespace is first re-exported here")]
1600    pub first_reexport: Span,
1601    #[label("but the name `{$name}` in the {$namespace} namespace is also re-exported here")]
1602    pub duplicate_reexport: Span,
1603
1604    pub name: String,
1605    pub namespace: String,
1606}
1607
1608#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            HiddenGlobReexports 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 {
                    HiddenGlobReexports {
                        glob_reexport: __binding_0,
                        private_item: __binding_1,
                        name: __binding_2,
                        namespace: __binding_3 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("private item shadows public glob re-export")));
                        ;
                        diag.arg("name", __binding_2);
                        diag.arg("namespace", __binding_3);
                        diag.span_note(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the name `{$name}` in the {$namespace} namespace is supposed to be publicly re-exported here")));
                        diag.span_note(__binding_1,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("but the private item here shadows it")));
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1609#[diag("private item shadows public glob re-export")]
1610pub(crate) struct HiddenGlobReexports {
1611    #[note(
1612        "the name `{$name}` in the {$namespace} namespace is supposed to be publicly re-exported here"
1613    )]
1614    pub glob_reexport: Span,
1615    #[note("but the private item here shadows it")]
1616    pub private_item: Span,
1617
1618    pub name: String,
1619    pub namespace: String,
1620}
1621
1622#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            RedundantImport 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 {
                    RedundantImport { subs: __binding_0, ident: __binding_1 } =>
                        {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the item `{$ident}` is imported redundantly")));
                        ;
                        diag.arg("ident", __binding_1);
                        for __binding_0 in __binding_0 {
                            diag.subdiagnostic(__binding_0);
                        }
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1623#[diag("the item `{$ident}` is imported redundantly")]
1624pub(crate) struct RedundantImport {
1625    #[subdiagnostic]
1626    pub subs: Vec<RedundantImportSub>,
1627    pub ident: Ident,
1628}
1629
1630#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for RedundantImportSub {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    RedundantImportSub::ImportedHere {
                        span: __binding_0, ident: __binding_1 } => {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("ident".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_1,
                                &mut diag.long_ty_path));
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the item `{$ident}` is already imported here")),
                                &sub_args);
                        diag.span_label(__binding_0, __message);
                    }
                    RedundantImportSub::DefinedHere {
                        span: __binding_0, ident: __binding_1 } => {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("ident".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_1,
                                &mut diag.long_ty_path));
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the item `{$ident}` is already defined here")),
                                &sub_args);
                        diag.span_label(__binding_0, __message);
                    }
                    RedundantImportSub::ImportedPrelude {
                        span: __binding_0, ident: __binding_1 } => {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("ident".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_1,
                                &mut diag.long_ty_path));
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the item `{$ident}` is already imported by the extern prelude")),
                                &sub_args);
                        diag.span_label(__binding_0, __message);
                    }
                    RedundantImportSub::DefinedPrelude {
                        span: __binding_0, ident: __binding_1 } => {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("ident".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_1,
                                &mut diag.long_ty_path));
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the item `{$ident}` is already defined by the extern prelude")),
                                &sub_args);
                        diag.span_label(__binding_0, __message);
                    }
                }
            }
        }
    };Subdiagnostic)]
1631pub(crate) enum RedundantImportSub {
1632    #[label("the item `{$ident}` is already imported here")]
1633    ImportedHere {
1634        #[primary_span]
1635        span: Span,
1636        ident: Ident,
1637    },
1638    #[label("the item `{$ident}` is already defined here")]
1639    DefinedHere {
1640        #[primary_span]
1641        span: Span,
1642        ident: Ident,
1643    },
1644    #[label("the item `{$ident}` is already imported by the extern prelude")]
1645    ImportedPrelude {
1646        #[primary_span]
1647        span: Span,
1648        ident: Ident,
1649    },
1650    #[label("the item `{$ident}` is already defined by the extern prelude")]
1651    DefinedPrelude {
1652        #[primary_span]
1653        span: Span,
1654        ident: Ident,
1655    },
1656}
1657
1658#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            UnusedQualifications 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 {
                    UnusedQualifications { removal_span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("unnecessary qualification")));
                        let __code_39 =
                            [::alloc::__export::must_use({
                                                ::alloc::fmt::format(format_args!(""))
                                            })].into_iter();
                        ;
                        diag.span_suggestions_with_style(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("remove the unnecessary path segments")),
                            __code_39, rustc_errors::Applicability::MachineApplicable,
                            rustc_errors::SuggestionStyle::ShowAlways);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1659#[diag("unnecessary qualification")]
1660pub(crate) struct UnusedQualifications {
1661    #[suggestion(
1662        "remove the unnecessary path segments",
1663        style = "verbose",
1664        code = "",
1665        applicability = "machine-applicable"
1666    )]
1667    pub removal_span: Span,
1668}
1669
1670#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            AssociatedConstElidedLifetime 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 {
                    AssociatedConstElidedLifetime {
                        span: __binding_0,
                        code: __binding_1,
                        elided: __binding_2,
                        lifetimes_in_scope: __binding_3 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("{$elided ->\n        [true] `&` without an explicit lifetime name cannot be used here\n        *[false] `'_` cannot be used here\n    }")));
                        let __code_40 =
                            [::alloc::__export::must_use({
                                                ::alloc::fmt::format(format_args!("{0}", __binding_1))
                                            })].into_iter();
                        ;
                        diag.arg("code", __binding_1);
                        diag.arg("elided", __binding_2);
                        diag.span_suggestions_with_style(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("use the `'static` lifetime")),
                            __code_40, rustc_errors::Applicability::MachineApplicable,
                            rustc_errors::SuggestionStyle::ShowAlways);
                        diag.span_note(__binding_3,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("cannot automatically infer `'static` because of other lifetimes in scope")));
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1671#[diag(
1672    "{$elided ->
1673        [true] `&` without an explicit lifetime name cannot be used here
1674        *[false] `'_` cannot be used here
1675    }"
1676)]
1677pub(crate) struct AssociatedConstElidedLifetime {
1678    #[suggestion(
1679        "use the `'static` lifetime",
1680        style = "verbose",
1681        code = "{code}",
1682        applicability = "machine-applicable"
1683    )]
1684    pub span: Span,
1685
1686    pub code: &'static str,
1687    pub elided: bool,
1688    #[note("cannot automatically infer `'static` because of other lifetimes in scope")]
1689    pub lifetimes_in_scope: MultiSpan,
1690}