Skip to main content

rustc_resolve/
errors.rs

1use rustc_errors::codes::*;
2use rustc_errors::formatting::DiagMessageAddArg;
3use rustc_errors::{
4    Applicability, Diag, DiagArgValue, 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_gca: __binding_4,
                        help_gca: __binding_5 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("{$is_gca ->\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_gca", __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_gca ->
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_gca: 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_gca: 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
            AttributesContainingRustcAreReserved where
            G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    AttributesContainingRustcAreReserved { span: __binding_0 }
                        => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("attributes containing a segment starting with `rustc` are reserved for use by the `rustc` compiler")));
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1202#[diag(
1203    "attributes containing a segment starting with `rustc` are reserved for use by the `rustc` compiler"
1204)]
1205pub(crate) struct AttributesContainingRustcAreReserved {
1206    #[primary_span]
1207    pub(crate) span: Span,
1208}
1209
1210#[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)]
1211#[diag("cannot use {$article} {$descr} through an import")]
1212pub(crate) struct CannotUseThroughAnImport {
1213    #[primary_span]
1214    pub(crate) span: Span,
1215    pub(crate) article: &'static str,
1216    pub(crate) descr: &'static str,
1217    #[note("the {$descr} imported here")]
1218    pub(crate) binding_span: Option<Span>,
1219}
1220
1221#[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)]
1222#[diag("name `{$ident}` is reserved in attribute namespace")]
1223pub(crate) struct NameReservedInAttributeNamespace {
1224    #[primary_span]
1225    pub(crate) span: Span,
1226    pub(crate) ident: Symbol,
1227}
1228
1229#[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)]
1230#[diag("cannot find a built-in macro with name `{$ident}`")]
1231pub(crate) struct CannotFindBuiltinMacroWithName {
1232    #[primary_span]
1233    pub(crate) span: Span,
1234    pub(crate) ident: Ident,
1235}
1236
1237#[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)]
1238#[diag("tool `{$tool}` was already registered")]
1239pub(crate) struct ToolWasAlreadyRegistered {
1240    #[primary_span]
1241    pub(crate) span: Span,
1242    pub(crate) tool: Ident,
1243    #[label("already registered here")]
1244    pub(crate) old_ident_span: Span,
1245}
1246
1247#[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)]
1248pub(crate) enum DefinedHere {
1249    #[label("similarly named {$candidate_descr} `{$candidate}` defined here")]
1250    SimilarlyNamed {
1251        #[primary_span]
1252        span: Span,
1253        candidate_descr: &'static str,
1254        candidate: Symbol,
1255    },
1256    #[label("{$candidate_descr} `{$candidate}` defined here")]
1257    SingleItem {
1258        #[primary_span]
1259        span: Span,
1260        candidate_descr: &'static str,
1261        candidate: Symbol,
1262    },
1263}
1264
1265#[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)]
1266#[label("{$outer_ident_descr} `{$outer_ident}` is not publicly re-exported")]
1267pub(crate) struct OuterIdentIsNotPubliclyReexported {
1268    #[primary_span]
1269    pub(crate) span: Span,
1270    pub(crate) outer_ident_descr: &'static str,
1271    pub(crate) outer_ident: Ident,
1272}
1273
1274#[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)]
1275#[label("a constructor is private if any of the fields is private")]
1276pub(crate) struct ConstructorPrivateIfAnyFieldPrivate {
1277    #[primary_span]
1278    pub(crate) span: Span,
1279}
1280
1281#[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)]
1282#[multipart_suggestion(
1283    "{ $number_of_fields ->
1284        [one] consider making the field publicly accessible
1285        *[other] consider making the fields publicly accessible
1286    }",
1287    applicability = "maybe-incorrect",
1288    style = "verbose"
1289)]
1290pub(crate) struct ConsiderMakingTheFieldPublic {
1291    #[suggestion_part(code = "pub ")]
1292    pub(crate) spans: Vec<Span>,
1293    pub(crate) number_of_fields: usize,
1294}
1295
1296#[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)]
1297pub(crate) enum ImportIdent {
1298    #[suggestion(
1299        "import `{$ident}` through the re-export",
1300        code = "{path}",
1301        applicability = "machine-applicable",
1302        style = "verbose"
1303    )]
1304    ThroughReExport {
1305        #[primary_span]
1306        span: Span,
1307        ident: Ident,
1308        path: String,
1309    },
1310    #[suggestion(
1311        "import `{$ident}` directly",
1312        code = "{path}",
1313        applicability = "machine-applicable",
1314        style = "verbose"
1315    )]
1316    Directly {
1317        #[primary_span]
1318        span: Span,
1319        ident: Ident,
1320        path: String,
1321    },
1322}
1323
1324#[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)]
1325#[note(
1326    "{$first ->
1327        [true] {$dots ->
1328            [true] the {$binding_descr} `{$binding_name}` is defined here...
1329            *[false] the {$binding_descr} `{$binding_name}` is defined here
1330        }
1331        *[false] {$dots ->
1332            [true] ...and refers to the {$binding_descr} `{$binding_name}` which is defined here...
1333            *[false] ...and refers to the {$binding_descr} `{$binding_name}` which is defined here
1334        }
1335    }"
1336)]
1337pub(crate) struct NoteAndRefersToTheItemDefinedHere<'a> {
1338    #[primary_span]
1339    pub(crate) span: MultiSpan,
1340    pub(crate) binding_descr: &'a str,
1341    pub(crate) binding_name: Ident,
1342    pub(crate) first: bool,
1343    pub(crate) dots: bool,
1344}
1345
1346#[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)]
1347#[suggestion("remove unnecessary import", code = "", applicability = "maybe-incorrect")]
1348pub(crate) struct RemoveUnnecessaryImport {
1349    #[primary_span]
1350    pub(crate) span: Span,
1351}
1352
1353#[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)]
1354#[suggestion(
1355    "remove unnecessary import",
1356    code = "",
1357    applicability = "maybe-incorrect",
1358    style = "tool-only"
1359)]
1360pub(crate) struct ToolOnlyRemoveUnnecessaryImport {
1361    #[primary_span]
1362    pub(crate) span: Span,
1363}
1364
1365#[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)]
1366#[note("`{$imported_ident}` is imported here, but it is {$imported_ident_desc}")]
1367pub(crate) struct IdentImporterHereButItIsDesc<'a> {
1368    #[primary_span]
1369    pub(crate) span: Span,
1370    pub(crate) imported_ident: Ident,
1371    pub(crate) imported_ident_desc: &'a str,
1372}
1373
1374#[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)]
1375#[note("`{$imported_ident}` is in scope, but it is {$imported_ident_desc}")]
1376pub(crate) struct IdentInScopeButItIsDesc<'a> {
1377    pub(crate) imported_ident: Ident,
1378    pub(crate) imported_ident_desc: &'a str,
1379}
1380
1381pub(crate) struct FoundItemConfigureOut {
1382    pub(crate) span: Span,
1383    pub(crate) item_was: ItemWas,
1384}
1385
1386pub(crate) enum ItemWas {
1387    BehindFeature { feature: Symbol, span: Span },
1388    CfgOut { span: Span },
1389}
1390
1391impl Subdiagnostic for FoundItemConfigureOut {
1392    fn add_to_diag<G: EmissionGuarantee>(self, diag: &mut Diag<'_, G>) {
1393        let mut multispan: MultiSpan = self.span.into();
1394        match self.item_was {
1395            ItemWas::BehindFeature { feature, span } => {
1396                let value = feature.into_diag_arg(&mut None);
1397                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")
1398                    .arg("feature", value)
1399                    .format();
1400                multispan.push_span_label(span, msg);
1401            }
1402            ItemWas::CfgOut { span } => {
1403                multispan.push_span_label(span, rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the item is gated here"))msg!("the item is gated here"));
1404            }
1405        }
1406        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"));
1407    }
1408}
1409
1410#[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)]
1411#[diag("item `{$name}` is an associated {$kind}, which doesn't match its trait `{$trait_path}`")]
1412pub(crate) struct TraitImplMismatch {
1413    #[primary_span]
1414    #[label("does not match trait")]
1415    pub(crate) span: Span,
1416    pub(crate) name: Ident,
1417    pub(crate) kind: &'static str,
1418    pub(crate) trait_path: String,
1419    #[label("item in trait")]
1420    pub(crate) trait_item_span: Span,
1421}
1422
1423#[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)]
1424#[diag("derive helper attribute is used before it is introduced")]
1425pub(crate) struct LegacyDeriveHelpers {
1426    #[label("the attribute is introduced here")]
1427    pub span: Span,
1428}
1429
1430#[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)]
1431#[diag("unused extern crate")]
1432pub(crate) struct UnusedExternCrate {
1433    #[label("unused")]
1434    pub span: Span,
1435    #[suggestion(
1436        "remove the unused `extern crate`",
1437        code = "",
1438        applicability = "machine-applicable",
1439        style = "verbose"
1440    )]
1441    pub removal_span: Span,
1442}
1443
1444#[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)]
1445#[diag("{$kind} `{$name}` from private dependency '{$krate}' is re-exported")]
1446pub(crate) struct ReexportPrivateDependency {
1447    pub name: Symbol,
1448    pub kind: &'static str,
1449    pub krate: Symbol,
1450}
1451
1452#[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)]
1453#[diag("unused label")]
1454pub(crate) struct UnusedLabel;
1455
1456#[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)]
1457#[diag("unused `#[macro_use]` import")]
1458pub(crate) struct UnusedMacroUse;
1459
1460#[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)]
1461#[diag("applying the `#[macro_use]` attribute to an `extern crate` item is deprecated")]
1462#[help("remove it and import macros at use sites with a `use` item instead")]
1463pub(crate) struct MacroUseDeprecated;
1464
1465#[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)]
1466#[diag("macro `{$ident}` is private")]
1467pub(crate) struct MacroIsPrivate {
1468    pub ident: Ident,
1469}
1470
1471#[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)]
1472#[diag("unused macro definition: `{$name}`")]
1473pub(crate) struct UnusedMacroDefinition {
1474    pub name: Symbol,
1475}
1476
1477#[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)]
1478#[diag("rule #{$n} of macro `{$name}` is never used")]
1479pub(crate) struct MacroRuleNeverUsed {
1480    pub n: usize,
1481    pub name: Symbol,
1482}
1483
1484#[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)]
1485#[diag("`extern crate` is not idiomatic in the new edition")]
1486pub(crate) struct ExternCrateNotIdiomatic {
1487    #[suggestion(
1488        "convert it to a `use`",
1489        style = "verbose",
1490        code = "{code}",
1491        applicability = "machine-applicable"
1492    )]
1493    pub span: Span,
1494    pub code: &'static str,
1495}
1496
1497#[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)]
1498#[diag("cannot find macro `{$path}` in the current scope when looking from {$location}")]
1499#[help("import `macro_rules` with `use` to make it callable above its definition")]
1500pub(crate) struct OutOfScopeMacroCalls {
1501    #[label("not found from {$location}")]
1502    pub span: Span,
1503    pub path: String,
1504    pub location: String,
1505}
1506
1507#[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)]
1508#[diag(
1509    "glob import doesn't reexport anything with visibility `{$import_vis}` because no imported item is public enough"
1510)]
1511pub(crate) struct RedundantImportVisibility {
1512    #[note("the most public imported item is `{$max_vis}`")]
1513    pub span: Span,
1514    #[help("reduce the glob import's visibility or increase visibility of imported items")]
1515    pub help: (),
1516    pub import_vis: String,
1517    pub max_vis: String,
1518}
1519
1520#[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 { help: __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)]
1521#[diag("unknown diagnostic attribute")]
1522pub(crate) struct UnknownDiagnosticAttribute {
1523    #[subdiagnostic]
1524    pub help: Option<UnknownDiagnosticAttributeHelp>,
1525}
1526
1527#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for UnknownDiagnosticAttributeHelp {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    UnknownDiagnosticAttributeHelp::Typo {
                        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);
                    }
                    UnknownDiagnosticAttributeHelp::UseFeature {
                        feature: __binding_0 } => {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("feature".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("add `#![feature({$feature})]` to the crate attributes to enable")),
                                &sub_args);
                        diag.help(__message);
                    }
                }
            }
        }
    };Subdiagnostic)]
1528pub(crate) enum UnknownDiagnosticAttributeHelp {
1529    #[suggestion(
1530        "an attribute with a similar name exists",
1531        style = "verbose",
1532        code = "{typo_name}",
1533        applicability = "machine-applicable"
1534    )]
1535    Typo {
1536        #[primary_span]
1537        span: Span,
1538        typo_name: Symbol,
1539    },
1540    #[help("add `#![feature({$feature})]` to the crate attributes to enable")]
1541    UseFeature { feature: Symbol },
1542}
1543
1544// FIXME: Make this properly translatable.
1545pub(crate) struct Ambiguity {
1546    pub ident: Ident,
1547    pub ambig_vis: Option<String>,
1548    pub kind: &'static str,
1549    pub help: Option<&'static [&'static str]>,
1550    pub b1_note: Spanned<String>,
1551    pub b1_help_msgs: Vec<String>,
1552    pub b2_note: Spanned<String>,
1553    pub b2_help_msgs: Vec<String>,
1554    /// If false, then it's a lint, if true, then it's an error with the `E0659` error code.
1555    pub is_error: bool,
1556}
1557
1558impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for Ambiguity {
1559    fn into_diag(self, dcx: DiagCtxtHandle<'a>, level: Level) -> Diag<'a, G> {
1560        let Self {
1561            ident,
1562            ambig_vis,
1563            kind,
1564            help,
1565            b1_note,
1566            b1_help_msgs,
1567            b2_note,
1568            b2_help_msgs,
1569            is_error,
1570        } = self;
1571
1572        let mut diag = Diag::new(dcx, level, "").with_span(ident.span);
1573        if is_error {
1574            diag.code(E0659);
1575        }
1576        if let Some(ambig_vis) = ambig_vis {
1577            diag.primary_message(::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("ambiguous import visibility: {0}",
                ambig_vis))
    })format!("ambiguous import visibility: {ambig_vis}"));
1578        } else {
1579            diag.primary_message(::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("`{0}` is ambiguous", ident))
    })format!("`{}` is ambiguous", ident));
1580            diag.span_label(ident.span, "ambiguous name");
1581        }
1582        diag.note(::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("ambiguous because of {0}", kind))
    })format!("ambiguous because of {}", kind));
1583        diag.span_note(b1_note.span, b1_note.node);
1584        if let Some(help) = help {
1585            for help in help {
1586                diag.help(*help);
1587            }
1588        }
1589        for help_msg in b1_help_msgs {
1590            diag.help(help_msg);
1591        }
1592        diag.span_note(b2_note.span, b2_note.node);
1593        for help_msg in b2_help_msgs {
1594            diag.help(help_msg);
1595        }
1596        diag
1597    }
1598}
1599
1600#[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)]
1601#[diag("lifetime parameter `{$ident}` never used")]
1602pub(crate) struct UnusedLifetime {
1603    #[suggestion("elide the unused lifetime", code = "", applicability = "machine-applicable")]
1604    pub deletion_span: Option<Span>,
1605
1606    pub ident: Ident,
1607}
1608
1609#[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)]
1610#[diag("ambiguous glob re-exports")]
1611pub(crate) struct AmbiguousGlobReexports {
1612    #[label("the name `{$name}` in the {$namespace} namespace is first re-exported here")]
1613    pub first_reexport: Span,
1614    #[label("but the name `{$name}` in the {$namespace} namespace is also re-exported here")]
1615    pub duplicate_reexport: Span,
1616
1617    pub name: String,
1618    pub namespace: String,
1619}
1620
1621#[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)]
1622#[diag("private item shadows public glob re-export")]
1623pub(crate) struct HiddenGlobReexports {
1624    #[note(
1625        "the name `{$name}` in the {$namespace} namespace is supposed to be publicly re-exported here"
1626    )]
1627    pub glob_reexport: Span,
1628    #[note("but the private item here shadows it")]
1629    pub private_item: Span,
1630
1631    pub name: String,
1632    pub namespace: String,
1633}
1634
1635#[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)]
1636#[diag("the item `{$ident}` is imported redundantly")]
1637pub(crate) struct RedundantImport {
1638    #[subdiagnostic]
1639    pub subs: Vec<RedundantImportSub>,
1640    pub ident: Ident,
1641}
1642
1643#[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)]
1644pub(crate) enum RedundantImportSub {
1645    #[label("the item `{$ident}` is already imported here")]
1646    ImportedHere {
1647        #[primary_span]
1648        span: Span,
1649        ident: Ident,
1650    },
1651    #[label("the item `{$ident}` is already defined here")]
1652    DefinedHere {
1653        #[primary_span]
1654        span: Span,
1655        ident: Ident,
1656    },
1657    #[label("the item `{$ident}` is already imported by the extern prelude")]
1658    ImportedPrelude {
1659        #[primary_span]
1660        span: Span,
1661        ident: Ident,
1662    },
1663    #[label("the item `{$ident}` is already defined by the extern prelude")]
1664    DefinedPrelude {
1665        #[primary_span]
1666        span: Span,
1667        ident: Ident,
1668    },
1669}
1670
1671#[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)]
1672#[diag("unnecessary qualification")]
1673pub(crate) struct UnusedQualifications {
1674    #[suggestion(
1675        "remove the unnecessary path segments",
1676        style = "verbose",
1677        code = "",
1678        applicability = "machine-applicable"
1679    )]
1680    pub removal_span: Span,
1681}
1682
1683#[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)]
1684#[diag(
1685    "{$elided ->
1686        [true] `&` without an explicit lifetime name cannot be used here
1687        *[false] `'_` cannot be used here
1688    }"
1689)]
1690pub(crate) struct AssociatedConstElidedLifetime {
1691    #[suggestion(
1692        "use the `'static` lifetime",
1693        style = "verbose",
1694        code = "{code}",
1695        applicability = "machine-applicable"
1696    )]
1697    pub span: Span,
1698
1699    pub code: &'static str,
1700    pub elided: bool,
1701    #[note("cannot automatically infer `'static` because of other lifetimes in scope")]
1702    pub lifetimes_in_scope: MultiSpan,
1703}
1704
1705#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            SingleUseLifetime where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    SingleUseLifetime {
                        param_span: __binding_0,
                        use_span: __binding_1,
                        suggestion: __binding_2,
                        ident: __binding_3 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("lifetime parameter `{$ident}` only used once")));
                        ;
                        diag.arg("ident", __binding_3);
                        diag.span_label(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("this lifetime...")));
                        diag.span_label(__binding_1,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("...is used only here")));
                        if let Some(__binding_2) = __binding_2 {
                            diag.subdiagnostic(__binding_2);
                        }
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1706#[diag("lifetime parameter `{$ident}` only used once")]
1707pub(crate) struct SingleUseLifetime {
1708    #[label("this lifetime...")]
1709    pub param_span: Span,
1710    #[label("...is used only here")]
1711    pub use_span: Span,
1712    #[subdiagnostic]
1713    pub suggestion: Option<SingleUseLifetimeSugg>,
1714
1715    pub ident: Ident,
1716}
1717
1718#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for SingleUseLifetimeSugg {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    SingleUseLifetimeSugg {
                        deletion_span: __binding_0,
                        use_span: __binding_1,
                        replace_lt: __binding_2 } => {
                        let mut suggestions = Vec::new();
                        let __code_41 =
                            ::alloc::__export::must_use({
                                    ::alloc::fmt::format(format_args!(""))
                                });
                        let __code_42 =
                            ::alloc::__export::must_use({
                                    ::alloc::fmt::format(format_args!("{0}", __binding_2))
                                });
                        if let Some(__binding_0) = __binding_0 {
                            suggestions.push((__binding_0, __code_41));
                        }
                        suggestions.push((__binding_1, __code_42));
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("replace_lt".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("elide the single-use lifetime")),
                                &sub_args);
                        diag.multipart_suggestion_with_style(__message, suggestions,
                            rustc_errors::Applicability::MachineApplicable,
                            rustc_errors::SuggestionStyle::ShowCode);
                    }
                }
            }
        }
    };Subdiagnostic)]
1719#[multipart_suggestion("elide the single-use lifetime", applicability = "machine-applicable")]
1720pub(crate) struct SingleUseLifetimeSugg {
1721    #[suggestion_part(code = "")]
1722    pub deletion_span: Option<Span>,
1723    #[suggestion_part(code = "{replace_lt}")]
1724    pub use_span: Span,
1725
1726    pub replace_lt: String,
1727}
1728
1729#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            AbsPathWithModule where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    AbsPathWithModule { sugg: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition")));
                        ;
                        diag.subdiagnostic(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1730#[diag(
1731    "absolute paths must start with `self`, `super`, `crate`, or an external crate name in the 2018 edition"
1732)]
1733pub(crate) struct AbsPathWithModule {
1734    #[subdiagnostic]
1735    pub sugg: AbsPathWithModuleSugg,
1736}
1737
1738#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for AbsPathWithModuleSugg {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    AbsPathWithModuleSugg {
                        span: __binding_0,
                        applicability: __binding_1,
                        replacement: __binding_2 } => {
                        let __code_43 =
                            [::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("replacement".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("use `crate`")),
                                &sub_args);
                        diag.span_suggestions_with_style(__binding_0, __message,
                            __code_43, __binding_1,
                            rustc_errors::SuggestionStyle::ShowCode);
                    }
                }
            }
        }
    };Subdiagnostic)]
1739#[suggestion("use `crate`", code = "{replacement}")]
1740pub(crate) struct AbsPathWithModuleSugg {
1741    #[primary_span]
1742    pub span: Span,
1743    #[applicability]
1744    pub applicability: Applicability,
1745    pub replacement: String,
1746}
1747
1748#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            ElidedLifetimesInPaths where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    ElidedLifetimesInPaths { subdiag: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("hidden lifetime parameters in types are deprecated")));
                        ;
                        diag.subdiagnostic(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1749#[diag("hidden lifetime parameters in types are deprecated")]
1750pub(crate) struct ElidedLifetimesInPaths {
1751    #[subdiagnostic]
1752    pub subdiag: rustc_errors::ElidedLifetimeInPathSubdiag,
1753}
1754
1755#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for UnusedImports
            where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    UnusedImports {
                        sugg: __binding_0,
                        test_module_span: __binding_1,
                        span_snippets: __binding_2,
                        num_snippets: __binding_3 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("{$num_snippets ->\n        [one] unused import: {$span_snippets}\n        *[other] unused imports: {$span_snippets}\n    }")));
                        ;
                        diag.arg("span_snippets", __binding_2);
                        diag.arg("num_snippets", __binding_3);
                        diag.subdiagnostic(__binding_0);
                        if let Some(__binding_1) = __binding_1 {
                            diag.span_help(__binding_1,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("if this is a test module, consider adding a `#[cfg(test)]` to the containing module")));
                        }
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1756#[diag(
1757    "{$num_snippets ->
1758        [one] unused import: {$span_snippets}
1759        *[other] unused imports: {$span_snippets}
1760    }"
1761)]
1762pub(crate) struct UnusedImports {
1763    #[subdiagnostic]
1764    pub sugg: UnusedImportsSugg,
1765    #[help("if this is a test module, consider adding a `#[cfg(test)]` to the containing module")]
1766    pub test_module_span: Option<Span>,
1767
1768    pub span_snippets: DiagArgValue,
1769    pub num_snippets: usize,
1770}
1771
1772#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for UnusedImportsSugg {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    UnusedImportsSugg::RemoveWholeUse { span: __binding_0 } => {
                        let __code_44 =
                            [::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 the whole `use` item")),
                                &sub_args);
                        diag.span_suggestions_with_style(__binding_0, __message,
                            __code_44, rustc_errors::Applicability::MachineApplicable,
                            rustc_errors::SuggestionStyle::CompletelyHidden);
                    }
                    UnusedImportsSugg::RemoveImports {
                        remove_spans: __binding_0, num_to_remove: __binding_1 } => {
                        let mut suggestions = Vec::new();
                        let __code_45 =
                            ::alloc::__export::must_use({
                                    ::alloc::fmt::format(format_args!(""))
                                });
                        for __binding_0 in __binding_0 {
                            suggestions.push((__binding_0, __code_45.clone()));
                        }
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("num_to_remove".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("{$num_to_remove ->\n            [one] remove the unused import\n            *[other] remove the unused imports\n        }")),
                                &sub_args);
                        diag.multipart_suggestion_with_style(__message, suggestions,
                            rustc_errors::Applicability::MachineApplicable,
                            rustc_errors::SuggestionStyle::CompletelyHidden);
                    }
                }
            }
        }
    };Subdiagnostic)]
1773pub(crate) enum UnusedImportsSugg {
1774    #[suggestion(
1775        "remove the whole `use` item",
1776        applicability = "machine-applicable",
1777        code = "",
1778        style = "tool-only"
1779    )]
1780    RemoveWholeUse {
1781        #[primary_span]
1782        span: Span,
1783    },
1784    #[multipart_suggestion(
1785        "{$num_to_remove ->
1786            [one] remove the unused import
1787            *[other] remove the unused imports
1788        }",
1789        applicability = "machine-applicable",
1790        style = "tool-only"
1791    )]
1792    RemoveImports {
1793        #[suggestion_part(code = "")]
1794        remove_spans: Vec<Span>,
1795        num_to_remove: usize,
1796    },
1797}