Skip to main content

rustc_ast_lowering/
errors.rs

1use rustc_errors::codes::*;
2use rustc_errors::{DiagArgFromDisplay, DiagSymbolList};
3use rustc_macros::{Diagnostic, Subdiagnostic};
4use rustc_span::{Ident, Span, Symbol};
5
6#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            GenericTypeWithParentheses where
            G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    GenericTypeWithParentheses {
                        span: __binding_0, sub: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("parenthesized type parameters may only be used with a `Fn` trait")));
                        diag.code(E0214);
                        ;
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("only `Fn` traits may use parentheses")));
                        if let Some(__binding_1) = __binding_1 {
                            diag.subdiagnostic(__binding_1);
                        }
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
7#[diag("parenthesized type parameters may only be used with a `Fn` trait", code = E0214)]
8pub(crate) struct GenericTypeWithParentheses {
9    #[primary_span]
10    #[label("only `Fn` traits may use parentheses")]
11    pub span: Span,
12    #[subdiagnostic]
13    pub sub: Option<UseAngleBrackets>,
14}
15
16#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for UseAngleBrackets {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    UseAngleBrackets {
                        open_param: __binding_0, close_param: __binding_1 } => {
                        let mut suggestions = Vec::new();
                        let __code_0 =
                            ::alloc::__export::must_use({
                                    ::alloc::fmt::format(format_args!("<"))
                                });
                        let __code_1 =
                            ::alloc::__export::must_use({
                                    ::alloc::fmt::format(format_args!(">"))
                                });
                        suggestions.push((__binding_0, __code_0));
                        suggestions.push((__binding_1, __code_1));
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("use angle brackets instead")),
                                &sub_args);
                        diag.multipart_suggestion_with_style(__message, suggestions,
                            rustc_errors::Applicability::MaybeIncorrect,
                            rustc_errors::SuggestionStyle::ShowCode);
                    }
                }
            }
        }
    };Subdiagnostic)]
17#[multipart_suggestion("use angle brackets instead", applicability = "maybe-incorrect")]
18pub(crate) struct UseAngleBrackets {
19    #[suggestion_part(code = "<")]
20    pub open_param: Span,
21    #[suggestion_part(code = ">")]
22    pub close_param: Span,
23}
24
25#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for InvalidAbi
            where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    InvalidAbi {
                        span: __binding_0,
                        abi: __binding_1,
                        command: __binding_2,
                        suggestion: __binding_3 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("invalid ABI: found `{$abi}`")));
                        diag.code(E0703);
                        diag.note(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("invoke `{$command}` for a full list of supported calling conventions")));
                        ;
                        diag.arg("abi", __binding_1);
                        diag.arg("command", __binding_2);
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("invalid ABI")));
                        if let Some(__binding_3) = __binding_3 {
                            diag.subdiagnostic(__binding_3);
                        }
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
26#[diag("invalid ABI: found `{$abi}`", code = E0703)]
27#[note("invoke `{$command}` for a full list of supported calling conventions")]
28pub(crate) struct InvalidAbi {
29    #[primary_span]
30    #[label("invalid ABI")]
31    pub span: Span,
32    pub abi: Symbol,
33    pub command: String,
34    #[subdiagnostic]
35    pub suggestion: Option<InvalidAbiSuggestion>,
36}
37
38#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            TupleStructWithDefault where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    TupleStructWithDefault { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("default fields are not supported in tuple structs")));
                        ;
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("default fields are only supported on structs")));
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
39#[diag("default fields are not supported in tuple structs")]
40pub(crate) struct TupleStructWithDefault {
41    #[primary_span]
42    #[label("default fields are only supported on structs")]
43    pub span: Span,
44}
45
46#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for InvalidAbiSuggestion {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    InvalidAbiSuggestion {
                        span: __binding_0, suggestion: __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("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("there's a similarly named valid ABI `{$suggestion}`")),
                                &sub_args);
                        diag.span_suggestions_with_style(__binding_0, __message,
                            __code_2, rustc_errors::Applicability::MaybeIncorrect,
                            rustc_errors::SuggestionStyle::ShowAlways);
                    }
                }
            }
        }
    };Subdiagnostic)]
47#[suggestion(
48    "there's a similarly named valid ABI `{$suggestion}`",
49    code = "\"{suggestion}\"",
50    applicability = "maybe-incorrect",
51    style = "verbose"
52)]
53pub(crate) struct InvalidAbiSuggestion {
54    #[primary_span]
55    pub span: Span,
56    pub suggestion: String,
57}
58
59#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            AssocTyParentheses where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    AssocTyParentheses { span: __binding_0, sub: __binding_1 }
                        => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("parenthesized generic arguments cannot be used in associated type constraints")));
                        ;
                        diag.span(__binding_0);
                        diag.subdiagnostic(__binding_1);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
60#[diag("parenthesized generic arguments cannot be used in associated type constraints")]
61pub(crate) struct AssocTyParentheses {
62    #[primary_span]
63    pub span: Span,
64    #[subdiagnostic]
65    pub sub: AssocTyParenthesesSub,
66}
67
68#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for AssocTyParenthesesSub {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    AssocTyParenthesesSub::Empty { parentheses_span: __binding_0
                        } => {
                        let mut suggestions = Vec::new();
                        let __code_3 =
                            ::alloc::__export::must_use({
                                    ::alloc::fmt::format(format_args!(""))
                                });
                        suggestions.push((__binding_0, __code_3));
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("remove these parentheses")),
                                &sub_args);
                        diag.multipart_suggestion_with_style(__message, suggestions,
                            rustc_errors::Applicability::Unspecified,
                            rustc_errors::SuggestionStyle::ShowCode);
                    }
                    AssocTyParenthesesSub::NotEmpty {
                        open_param: __binding_0, close_param: __binding_1 } => {
                        let mut suggestions = Vec::new();
                        let __code_4 =
                            ::alloc::__export::must_use({
                                    ::alloc::fmt::format(format_args!("<"))
                                });
                        let __code_5 =
                            ::alloc::__export::must_use({
                                    ::alloc::fmt::format(format_args!(">"))
                                });
                        suggestions.push((__binding_0, __code_4));
                        suggestions.push((__binding_1, __code_5));
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("use angle brackets instead")),
                                &sub_args);
                        diag.multipart_suggestion_with_style(__message, suggestions,
                            rustc_errors::Applicability::Unspecified,
                            rustc_errors::SuggestionStyle::ShowCode);
                    }
                }
            }
        }
    };Subdiagnostic)]
69pub(crate) enum AssocTyParenthesesSub {
70    #[multipart_suggestion("remove these parentheses")]
71    Empty {
72        #[suggestion_part(code = "")]
73        parentheses_span: Span,
74    },
75    #[multipart_suggestion("use angle brackets instead")]
76    NotEmpty {
77        #[suggestion_part(code = "<")]
78        open_param: Span,
79        #[suggestion_part(code = ">")]
80        close_param: Span,
81    },
82}
83
84#[derive(const _: () =
    {
        impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
            MisplacedImplTrait<'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 {
                    MisplacedImplTrait {
                        span: __binding_0, position: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`impl Trait` is not allowed in {$position}")));
                        diag.code(E0562);
                        diag.note(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`impl Trait` is only allowed in arguments and return types of functions and methods")));
                        ;
                        diag.arg("position", __binding_1);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
85#[diag("`impl Trait` is not allowed in {$position}", code = E0562)]
86#[note("`impl Trait` is only allowed in arguments and return types of functions and methods")]
87pub(crate) struct MisplacedImplTrait<'a> {
88    #[primary_span]
89    pub span: Span,
90    pub position: DiagArgFromDisplay<'a>,
91}
92
93#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            MisplacedAssocTyBinding where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    MisplacedAssocTyBinding {
                        span: __binding_0, suggestion: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("associated type bounds are not allowed in `dyn` types")));
                        let __code_6 =
                            [::alloc::__export::must_use({
                                                ::alloc::fmt::format(format_args!(" = impl"))
                                            })].into_iter();
                        ;
                        diag.span(__binding_0);
                        if let Some(__binding_1) = __binding_1 {
                            diag.span_suggestions_with_style(__binding_1,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("use `impl Trait` to introduce a type instead")),
                                __code_6, rustc_errors::Applicability::MaybeIncorrect,
                                rustc_errors::SuggestionStyle::ShowAlways);
                        }
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
94#[diag("associated type bounds are not allowed in `dyn` types")]
95pub(crate) struct MisplacedAssocTyBinding {
96    #[primary_span]
97    pub span: Span,
98    #[suggestion(
99        "use `impl Trait` to introduce a type instead",
100        code = " = impl",
101        applicability = "maybe-incorrect",
102        style = "verbose"
103    )]
104    pub suggestion: Option<Span>,
105}
106
107#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            UnderscoreExprLhsAssign where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    UnderscoreExprLhsAssign { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("in expressions, `_` can only be used on the left-hand side of an assignment")));
                        ;
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`_` not allowed here")));
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
108#[diag("in expressions, `_` can only be used on the left-hand side of an assignment")]
109pub(crate) struct UnderscoreExprLhsAssign {
110    #[primary_span]
111    #[label("`_` not allowed here")]
112    pub span: Span,
113}
114
115#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            AwaitOnlyInAsyncFnAndBlocks where
            G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    AwaitOnlyInAsyncFnAndBlocks {
                        await_kw_span: __binding_0, item_span: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`await` is only allowed inside `async` functions and blocks")));
                        diag.code(E0728);
                        ;
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("only allowed inside `async` functions and blocks")));
                        if let Some(__binding_1) = __binding_1 {
                            diag.span_label(__binding_1,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("this is not `async`")));
                        }
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
116#[diag("`await` is only allowed inside `async` functions and blocks", code = E0728)]
117pub(crate) struct AwaitOnlyInAsyncFnAndBlocks {
118    #[primary_span]
119    #[label("only allowed inside `async` functions and blocks")]
120    pub await_kw_span: Span,
121    #[label("this is not `async`")]
122    pub item_span: Option<Span>,
123}
124
125#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            CoroutineTooManyParameters where
            G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    CoroutineTooManyParameters { fn_decl_span: __binding_0 } =>
                        {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("too many parameters for a coroutine (expected 0 or 1 parameters)")));
                        diag.code(E0628);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
126#[diag("too many parameters for a coroutine (expected 0 or 1 parameters)", code = E0628)]
127pub(crate) struct CoroutineTooManyParameters {
128    #[primary_span]
129    pub fn_decl_span: Span,
130}
131
132#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            ClosureCannotBeStatic where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    ClosureCannotBeStatic { fn_decl_span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("closures cannot be static")));
                        diag.code(E0697);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
133#[diag("closures cannot be static", code = E0697)]
134pub(crate) struct ClosureCannotBeStatic {
135    #[primary_span]
136    pub fn_decl_span: Span,
137}
138
139#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            MoveExprOnlyInPlainClosures where
            G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    MoveExprOnlyInPlainClosures { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`move(expr)` is only supported in plain closures")));
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
140#[diag("`move(expr)` is only supported in plain closures")]
141pub(crate) struct MoveExprOnlyInPlainClosures {
142    #[primary_span]
143    pub span: Span,
144}
145
146#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            FunctionalRecordUpdateDestructuringAssignment where
            G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    FunctionalRecordUpdateDestructuringAssignment {
                        span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("functional record updates are not allowed in destructuring assignments")));
                        let __code_7 =
                            [::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("consider removing the trailing pattern")),
                            __code_7, rustc_errors::Applicability::MachineApplicable,
                            rustc_errors::SuggestionStyle::ShowCode);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
147#[diag("functional record updates are not allowed in destructuring assignments")]
148pub(crate) struct FunctionalRecordUpdateDestructuringAssignment {
149    #[primary_span]
150    #[suggestion(
151        "consider removing the trailing pattern",
152        code = "",
153        applicability = "machine-applicable"
154    )]
155    pub span: Span,
156}
157
158#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            AsyncCoroutinesNotSupported where
            G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    AsyncCoroutinesNotSupported { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`async` coroutines are not yet supported")));
                        diag.code(E0727);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
159#[diag("`async` coroutines are not yet supported", code = E0727)]
160pub(crate) struct AsyncCoroutinesNotSupported {
161    #[primary_span]
162    pub span: Span,
163}
164
165#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            InlineAsmUnsupportedTarget where
            G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    InlineAsmUnsupportedTarget { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("inline assembly is unsupported on this target")));
                        diag.code(E0472);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
166#[diag("inline assembly is unsupported on this target", code = E0472)]
167pub(crate) struct InlineAsmUnsupportedTarget {
168    #[primary_span]
169    pub span: Span,
170}
171
172#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            AttSyntaxOnlyX86 where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    AttSyntaxOnlyX86 { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the `att_syntax` option is only supported on x86")));
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
173#[diag("the `att_syntax` option is only supported on x86")]
174pub(crate) struct AttSyntaxOnlyX86 {
175    #[primary_span]
176    pub span: Span,
177}
178
179#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            AbiSpecifiedMultipleTimes where G: rustc_errors::EmissionGuarantee
            {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    AbiSpecifiedMultipleTimes {
                        abi_span: __binding_0,
                        prev_name: __binding_1,
                        prev_span: __binding_2,
                        equivalent: __binding_3 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`{$prev_name}` ABI specified multiple times")));
                        ;
                        diag.arg("prev_name", __binding_1);
                        diag.span(__binding_0);
                        diag.span_label(__binding_2,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("previously specified here")));
                        if __binding_3 {
                            diag.note(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("these ABIs are equivalent on the current target")));
                        }
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
180#[diag("`{$prev_name}` ABI specified multiple times")]
181pub(crate) struct AbiSpecifiedMultipleTimes {
182    #[primary_span]
183    pub abi_span: Span,
184    pub prev_name: Symbol,
185    #[label("previously specified here")]
186    pub prev_span: Span,
187    #[note("these ABIs are equivalent on the current target")]
188    pub equivalent: bool,
189}
190
191#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            ClobberAbiNotSupported where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    ClobberAbiNotSupported { abi_span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`clobber_abi` is not supported on this target")));
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
192#[diag("`clobber_abi` is not supported on this target")]
193pub(crate) struct ClobberAbiNotSupported {
194    #[primary_span]
195    pub abi_span: Span,
196}
197
198#[derive(const _: () =
    {
        impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
            InvalidAbiClobberAbi<'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 {
                    InvalidAbiClobberAbi {
                        abi_span: __binding_0, supported_abis: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("invalid ABI for `clobber_abi`")));
                        diag.note(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the following ABIs are supported on this target: {$supported_abis}")));
                        ;
                        diag.arg("supported_abis", __binding_1);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
199#[note("the following ABIs are supported on this target: {$supported_abis}")]
200#[diag("invalid ABI for `clobber_abi`")]
201pub(crate) struct InvalidAbiClobberAbi<'a> {
202    #[primary_span]
203    pub abi_span: Span,
204    pub supported_abis: DiagSymbolList<&'a str>,
205}
206
207#[derive(const _: () =
    {
        impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
            InvalidRegister<'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 {
                    InvalidRegister {
                        op_span: __binding_0, reg: __binding_1, error: __binding_2 }
                        => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("invalid register `{$reg}`: {$error}")));
                        ;
                        diag.arg("reg", __binding_1);
                        diag.arg("error", __binding_2);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
208#[diag("invalid register `{$reg}`: {$error}")]
209pub(crate) struct InvalidRegister<'a> {
210    #[primary_span]
211    pub op_span: Span,
212    pub reg: Symbol,
213    pub error: &'a str,
214}
215
216#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            InvalidRegisterClass where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    InvalidRegisterClass {
                        op_span: __binding_0,
                        reg_class: __binding_1,
                        supported_register_classes: __binding_2 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("invalid register class `{$reg_class}`: unknown register class")));
                        diag.note(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the following register classes are supported on this target: {$supported_register_classes}")));
                        ;
                        diag.arg("reg_class", __binding_1);
                        diag.arg("supported_register_classes", __binding_2);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
217#[note(
218    "the following register classes are supported on this target: {$supported_register_classes}"
219)]
220#[diag("invalid register class `{$reg_class}`: unknown register class")]
221pub(crate) struct InvalidRegisterClass {
222    #[primary_span]
223    pub op_span: Span,
224    pub reg_class: Symbol,
225    pub supported_register_classes: DiagSymbolList<Symbol>,
226}
227
228#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            InvalidAsmTemplateModifierRegClass where
            G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    InvalidAsmTemplateModifierRegClass {
                        placeholder_span: __binding_0,
                        op_span: __binding_1,
                        modifier: __binding_2,
                        sub: __binding_3 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("invalid asm template modifier `{$modifier}` for this register class")));
                        ;
                        diag.arg("modifier", __binding_2);
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("template modifier")));
                        diag.span_label(__binding_1,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("argument")));
                        diag.subdiagnostic(__binding_3);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
229#[diag("invalid asm template modifier `{$modifier}` for this register class")]
230pub(crate) struct InvalidAsmTemplateModifierRegClass {
231    #[primary_span]
232    #[label("template modifier")]
233    pub placeholder_span: Span,
234    #[label("argument")]
235    pub op_span: Span,
236    pub modifier: String,
237    #[subdiagnostic]
238    pub sub: InvalidAsmTemplateModifierRegClassSub,
239}
240
241#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for
            InvalidAsmTemplateModifierRegClassSub {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    InvalidAsmTemplateModifierRegClassSub::SupportModifier {
                        class_name: __binding_0, modifiers: __binding_1 } => {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("class_name".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_0,
                                &mut diag.long_ty_path));
                        sub_args.insert("modifiers".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 `{$class_name}` register class supports the following template modifiers: {$modifiers}")),
                                &sub_args);
                        diag.note(__message);
                    }
                    InvalidAsmTemplateModifierRegClassSub::DoesNotSupportModifier {
                        class_name: __binding_0 } => {
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("class_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("the `{$class_name}` register class does not support template modifiers")),
                                &sub_args);
                        diag.note(__message);
                    }
                }
            }
        }
    };Subdiagnostic)]
242pub(crate) enum InvalidAsmTemplateModifierRegClassSub {
243    #[note(
244        "the `{$class_name}` register class supports the following template modifiers: {$modifiers}"
245    )]
246    SupportModifier { class_name: Symbol, modifiers: DiagSymbolList<char> },
247    #[note("the `{$class_name}` register class does not support template modifiers")]
248    DoesNotSupportModifier { class_name: Symbol },
249}
250
251#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            InvalidAsmTemplateModifierConst where
            G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    InvalidAsmTemplateModifierConst {
                        placeholder_span: __binding_0, op_span: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("asm template modifiers are not allowed for `const` arguments")));
                        ;
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("template modifier")));
                        diag.span_label(__binding_1,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("argument")));
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
252#[diag("asm template modifiers are not allowed for `const` arguments")]
253pub(crate) struct InvalidAsmTemplateModifierConst {
254    #[primary_span]
255    #[label("template modifier")]
256    pub placeholder_span: Span,
257    #[label("argument")]
258    pub op_span: Span,
259}
260
261#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            InvalidAsmTemplateModifierSym where
            G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    InvalidAsmTemplateModifierSym {
                        placeholder_span: __binding_0, op_span: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("asm template modifiers are not allowed for `sym` arguments")));
                        ;
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("template modifier")));
                        diag.span_label(__binding_1,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("argument")));
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
262#[diag("asm template modifiers are not allowed for `sym` arguments")]
263pub(crate) struct InvalidAsmTemplateModifierSym {
264    #[primary_span]
265    #[label("template modifier")]
266    pub placeholder_span: Span,
267    #[label("argument")]
268    pub op_span: Span,
269}
270
271#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            InvalidAsmTemplateModifierLabel where
            G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    InvalidAsmTemplateModifierLabel {
                        placeholder_span: __binding_0, op_span: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("asm template modifiers are not allowed for `label` arguments")));
                        ;
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("template modifier")));
                        diag.span_label(__binding_1,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("argument")));
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
272#[diag("asm template modifiers are not allowed for `label` arguments")]
273pub(crate) struct InvalidAsmTemplateModifierLabel {
274    #[primary_span]
275    #[label("template modifier")]
276    pub placeholder_span: Span,
277    #[label("argument")]
278    pub op_span: Span,
279}
280
281#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            RegisterClassOnlyClobber where G: rustc_errors::EmissionGuarantee
            {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    RegisterClassOnlyClobber {
                        op_span: __binding_0, reg_class_name: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("register class `{$reg_class_name}` can only be used as a clobber, not as an input or output")));
                        ;
                        diag.arg("reg_class_name", __binding_1);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
282#[diag(
283    "register class `{$reg_class_name}` can only be used as a clobber, not as an input or output"
284)]
285pub(crate) struct RegisterClassOnlyClobber {
286    #[primary_span]
287    pub op_span: Span,
288    pub reg_class_name: Symbol,
289}
290
291#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            RegisterClassOnlyClobberStable where
            G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    RegisterClassOnlyClobberStable {
                        op_span: __binding_0, reg_class_name: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("register class `{$reg_class_name}` can only be used as a clobber in stable")));
                        ;
                        diag.arg("reg_class_name", __binding_1);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
292#[diag("register class `{$reg_class_name}` can only be used as a clobber in stable")]
293pub(crate) struct RegisterClassOnlyClobberStable {
294    #[primary_span]
295    pub op_span: Span,
296    pub reg_class_name: Symbol,
297}
298
299#[derive(const _: () =
    {
        impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
            RegisterConflict<'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 {
                    RegisterConflict {
                        op_span1: __binding_0,
                        op_span2: __binding_1,
                        reg1_name: __binding_2,
                        reg2_name: __binding_3,
                        in_out: __binding_4 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("register `{$reg1_name}` conflicts with register `{$reg2_name}`")));
                        ;
                        diag.arg("reg1_name", __binding_2);
                        diag.arg("reg2_name", __binding_3);
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("register `{$reg1_name}`")));
                        diag.span_label(__binding_1,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("register `{$reg2_name}`")));
                        if let Some(__binding_4) = __binding_4 {
                            diag.span_help(__binding_4,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("use `lateout` instead of `out` to avoid conflict")));
                        }
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
300#[diag("register `{$reg1_name}` conflicts with register `{$reg2_name}`")]
301pub(crate) struct RegisterConflict<'a> {
302    #[primary_span]
303    #[label("register `{$reg1_name}`")]
304    pub op_span1: Span,
305    #[label("register `{$reg2_name}`")]
306    pub op_span2: Span,
307    pub reg1_name: &'a str,
308    pub reg2_name: &'a str,
309    #[help("use `lateout` instead of `out` to avoid conflict")]
310    pub in_out: Option<Span>,
311}
312
313#[derive(const _: () =
    {
        impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
            SubTupleBinding<'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 {
                    SubTupleBinding {
                        span: __binding_0,
                        ident: __binding_1,
                        ident_name: __binding_2,
                        ctx: __binding_3 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`{$ident_name} @` is not allowed in a {$ctx}")));
                        let __code_8 =
                            [::alloc::__export::must_use({
                                                ::alloc::fmt::format(format_args!(".."))
                                            })].into_iter();
                        diag.help(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("remove this and bind each tuple field independently")));
                        ;
                        diag.arg("ident", __binding_1);
                        diag.arg("ident_name", __binding_2);
                        diag.arg("ctx", __binding_3);
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("this is only allowed in slice patterns")));
                        diag.span_suggestions_with_style(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("if you don't need to use the contents of {$ident}, discard the tuple's remaining fields")),
                            __code_8, rustc_errors::Applicability::MaybeIncorrect,
                            rustc_errors::SuggestionStyle::ShowAlways);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
314#[help("remove this and bind each tuple field independently")]
315#[diag("`{$ident_name} @` is not allowed in a {$ctx}")]
316pub(crate) struct SubTupleBinding<'a> {
317    #[primary_span]
318    #[label("this is only allowed in slice patterns")]
319    #[suggestion(
320        "if you don't need to use the contents of {$ident}, discard the tuple's remaining fields",
321        style = "verbose",
322        code = "..",
323        applicability = "maybe-incorrect"
324    )]
325    pub span: Span,
326    pub ident: Ident,
327    pub ident_name: Symbol,
328    pub ctx: &'a str,
329}
330
331#[derive(const _: () =
    {
        impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
            ExtraDoubleDot<'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 {
                    ExtraDoubleDot {
                        span: __binding_0, prev_span: __binding_1, ctx: __binding_2
                        } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`..` can only be used once per {$ctx} pattern")));
                        ;
                        diag.arg("ctx", __binding_2);
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("can only be used once per {$ctx} pattern")));
                        diag.span_label(__binding_1,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("previously used here")));
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
332#[diag("`..` can only be used once per {$ctx} pattern")]
333pub(crate) struct ExtraDoubleDot<'a> {
334    #[primary_span]
335    #[label("can only be used once per {$ctx} pattern")]
336    pub span: Span,
337    #[label("previously used here")]
338    pub prev_span: Span,
339    pub ctx: &'a str,
340}
341
342#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            MisplacedDoubleDot where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    MisplacedDoubleDot { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`..` patterns are not allowed here")));
                        diag.note(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("only allowed in tuple, tuple struct, and slice patterns")));
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
343#[note("only allowed in tuple, tuple struct, and slice patterns")]
344#[diag("`..` patterns are not allowed here")]
345pub(crate) struct MisplacedDoubleDot {
346    #[primary_span]
347    pub span: Span,
348}
349
350#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            MatchArmWithNoBody where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    MatchArmWithNoBody {
                        span: __binding_0, suggestion: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`match` arm with no body")));
                        let __code_9 =
                            [::alloc::__export::must_use({
                                                ::alloc::fmt::format(format_args!(" => todo!(),"))
                                            })].into_iter();
                        ;
                        diag.span(__binding_0);
                        diag.span_suggestions_with_style(__binding_1,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("add a body after the pattern")),
                            __code_9, rustc_errors::Applicability::HasPlaceholders,
                            rustc_errors::SuggestionStyle::ShowCode);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
351#[diag("`match` arm with no body")]
352pub(crate) struct MatchArmWithNoBody {
353    #[primary_span]
354    pub span: Span,
355    #[suggestion(
356        "add a body after the pattern",
357        code = " => todo!(),",
358        applicability = "has-placeholders"
359    )]
360    pub suggestion: Span,
361}
362
363#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            NeverPatternWithBody where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    NeverPatternWithBody { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("a never pattern is always unreachable")));
                        let __code_10 =
                            [::alloc::__export::must_use({
                                                ::alloc::fmt::format(format_args!(""))
                                            })].into_iter();
                        ;
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("this will never be executed")));
                        diag.span_suggestions_with_style(__binding_0,
                            rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("remove this expression")),
                            __code_10, rustc_errors::Applicability::MaybeIncorrect,
                            rustc_errors::SuggestionStyle::ShowCode);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
364#[diag("a never pattern is always unreachable")]
365pub(crate) struct NeverPatternWithBody {
366    #[primary_span]
367    #[label("this will never be executed")]
368    #[suggestion("remove this expression", code = "", applicability = "maybe-incorrect")]
369    pub span: Span,
370}
371
372#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            NeverPatternWithGuard where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    NeverPatternWithGuard { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("a guard on a never pattern will never be run")));
                        let __code_11 =
                            [::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("remove this guard")),
                            __code_11, rustc_errors::Applicability::MaybeIncorrect,
                            rustc_errors::SuggestionStyle::ShowCode);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
373#[diag("a guard on a never pattern will never be run")]
374pub(crate) struct NeverPatternWithGuard {
375    #[primary_span]
376    #[suggestion("remove this guard", code = "", applicability = "maybe-incorrect")]
377    pub span: Span,
378}
379
380#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            ArbitraryExpressionInPattern where
            G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    ArbitraryExpressionInPattern {
                        span: __binding_0,
                        pattern_from_macro_note: __binding_1,
                        const_block_in_pattern_help: __binding_2 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("arbitrary expressions aren't allowed in patterns")));
                        ;
                        diag.span(__binding_0);
                        if __binding_1 {
                            diag.note(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the `expr` fragment specifier forces the metavariable's content to be an expression")));
                        }
                        if __binding_2 {
                            diag.help(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("use a named `const`-item or an `if`-guard (`x if x == const {\"{ ... }\"}`) instead")));
                        }
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
381#[diag("arbitrary expressions aren't allowed in patterns")]
382pub(crate) struct ArbitraryExpressionInPattern {
383    #[primary_span]
384    pub span: Span,
385    #[note("the `expr` fragment specifier forces the metavariable's content to be an expression")]
386    pub pattern_from_macro_note: bool,
387    #[help("use a named `const`-item or an `if`-guard (`x if x == const {\"{ ... }\"}`) instead")]
388    pub const_block_in_pattern_help: bool,
389}
390
391#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            InclusiveRangeWithNoEnd where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    InclusiveRangeWithNoEnd { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("inclusive range with no end")));
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
392#[diag("inclusive range with no end")]
393pub(crate) struct InclusiveRangeWithNoEnd {
394    #[primary_span]
395    pub span: Span,
396}
397
398#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for RTNSuggestion {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    RTNSuggestion { output: __binding_0, input: __binding_1 } =>
                        {
                        let mut suggestions = Vec::new();
                        let __code_12 =
                            ::alloc::__export::must_use({
                                    ::alloc::fmt::format(format_args!(""))
                                });
                        let __code_13 =
                            ::alloc::__export::must_use({
                                    ::alloc::fmt::format(format_args!("(..)"))
                                });
                        suggestions.push((__binding_0, __code_12));
                        suggestions.push((__binding_1, __code_13));
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        let __message =
                            rustc_errors::format_diag_message(&rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("use the right argument notation and remove the return type")),
                                &sub_args);
                        diag.multipart_suggestion_with_style(__message, suggestions,
                            rustc_errors::Applicability::MachineApplicable,
                            rustc_errors::SuggestionStyle::ShowAlways);
                    }
                }
            }
        }
    };Subdiagnostic)]
399#[multipart_suggestion(
400    "use the right argument notation and remove the return type",
401    applicability = "machine-applicable",
402    style = "verbose"
403)]
404/// Given `T: Tr<m() -> Ret>` or `T: Tr<m(Ty) -> Ret>`, suggest `T: Tr<m(..)>`.
405pub(crate) struct RTNSuggestion {
406    #[suggestion_part(code = "")]
407    pub output: Span,
408    #[suggestion_part(code = "(..)")]
409    pub input: Span,
410}
411
412#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            BadReturnTypeNotation where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    BadReturnTypeNotation::Inputs { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("argument types not allowed with return type notation")));
                        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("remove the input types")),
                            __code_14, rustc_errors::Applicability::MachineApplicable,
                            rustc_errors::SuggestionStyle::ShowAlways);
                        diag
                    }
                    BadReturnTypeNotation::Output {
                        span: __binding_0, suggestion: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("return type not allowed with return type notation")));
                        ;
                        diag.span(__binding_0);
                        diag.subdiagnostic(__binding_1);
                        diag
                    }
                    BadReturnTypeNotation::NeedsDots { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("return type notation arguments must be elided with `..`")));
                        let __code_15 =
                            [::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 the correct syntax by adding `..` to the arguments")),
                            __code_15, rustc_errors::Applicability::MachineApplicable,
                            rustc_errors::SuggestionStyle::ShowAlways);
                        diag
                    }
                    BadReturnTypeNotation::Position { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("return type notation not allowed in this position yet")));
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
413pub(crate) enum BadReturnTypeNotation {
414    #[diag("argument types not allowed with return type notation")]
415    Inputs {
416        #[primary_span]
417        #[suggestion(
418            "remove the input types",
419            code = "(..)",
420            applicability = "machine-applicable",
421            style = "verbose"
422        )]
423        span: Span,
424    },
425    #[diag("return type not allowed with return type notation")]
426    Output {
427        #[primary_span]
428        span: Span,
429        #[subdiagnostic]
430        suggestion: RTNSuggestion,
431    },
432    #[diag("return type notation arguments must be elided with `..`")]
433    NeedsDots {
434        #[primary_span]
435        #[suggestion(
436            "use the correct syntax by adding `..` to the arguments",
437            code = "(..)",
438            applicability = "machine-applicable",
439            style = "verbose"
440        )]
441        span: Span,
442    },
443    #[diag("return type notation not allowed in this position yet")]
444    Position {
445        #[primary_span]
446        span: Span,
447    },
448}
449
450#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            GenericParamDefaultInBinder where
            G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    GenericParamDefaultInBinder { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("defaults for generic parameters are not allowed in `for<...>` binders")));
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
451#[diag("defaults for generic parameters are not allowed in `for<...>` binders")]
452pub(crate) struct GenericParamDefaultInBinder {
453    #[primary_span]
454    pub span: Span,
455}
456
457#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            AsyncBoundNotOnTrait where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    AsyncBoundNotOnTrait { span: __binding_0, descr: __binding_1
                        } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`async` bound modifier only allowed on trait, not `{$descr}`")));
                        ;
                        diag.arg("descr", __binding_1);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
458#[diag("`async` bound modifier only allowed on trait, not `{$descr}`")]
459pub(crate) struct AsyncBoundNotOnTrait {
460    #[primary_span]
461    pub span: Span,
462    pub descr: &'static str,
463}
464
465#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            AsyncBoundOnlyForFnTraits where G: rustc_errors::EmissionGuarantee
            {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    AsyncBoundOnlyForFnTraits { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`async` bound modifier only allowed on `Fn`/`FnMut`/`FnOnce` traits")));
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
466#[diag("`async` bound modifier only allowed on `Fn`/`FnMut`/`FnOnce` traits")]
467pub(crate) struct AsyncBoundOnlyForFnTraits {
468    #[primary_span]
469    pub span: Span,
470}
471
472#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            NoPreciseCapturesOnApit where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    NoPreciseCapturesOnApit { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`use<...>` precise capturing syntax not allowed in argument-position `impl Trait`")));
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
473#[diag("`use<...>` precise capturing syntax not allowed in argument-position `impl Trait`")]
474pub(crate) struct NoPreciseCapturesOnApit {
475    #[primary_span]
476    pub span: Span,
477}
478
479#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for YieldInClosure
            where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    YieldInClosure { span: __binding_0, suggestion: __binding_1
                        } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`yield` can only be used in `#[coroutine]` closures, or `gen` blocks")));
                        let __code_16 =
                            [::alloc::__export::must_use({
                                                ::alloc::fmt::format(format_args!("#[coroutine] "))
                                            })].into_iter();
                        ;
                        diag.span(__binding_0);
                        if let Some(__binding_1) = __binding_1 {
                            diag.span_suggestions_with_style(__binding_1,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("use `#[coroutine]` to make this closure a coroutine")),
                                __code_16, rustc_errors::Applicability::MaybeIncorrect,
                                rustc_errors::SuggestionStyle::ShowAlways);
                        }
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
480#[diag("`yield` can only be used in `#[coroutine]` closures, or `gen` blocks")]
481pub(crate) struct YieldInClosure {
482    #[primary_span]
483    pub span: Span,
484    #[suggestion(
485        "use `#[coroutine]` to make this closure a coroutine",
486        code = "#[coroutine] ",
487        applicability = "maybe-incorrect",
488        style = "verbose"
489    )]
490    pub suggestion: Option<Span>,
491}
492
493#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            InvalidLegacyConstGenericArg where
            G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    InvalidLegacyConstGenericArg {
                        span: __binding_0, suggestion: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("invalid argument to a legacy const generic: cannot have const blocks, closures, async blocks or items")));
                        ;
                        diag.span(__binding_0);
                        diag.subdiagnostic(__binding_1);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
494#[diag(
495    "invalid argument to a legacy const generic: cannot have const blocks, closures, async blocks or items"
496)]
497pub(crate) struct InvalidLegacyConstGenericArg {
498    #[primary_span]
499    pub span: Span,
500    #[subdiagnostic]
501    pub suggestion: UseConstGenericArg,
502}
503
504#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for UseConstGenericArg {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    UseConstGenericArg {
                        end_of_fn: __binding_0,
                        const_args: __binding_1,
                        other_args: __binding_2,
                        call_args: __binding_3 } => {
                        let mut suggestions = Vec::new();
                        let __code_17 =
                            ::alloc::__export::must_use({
                                    ::alloc::fmt::format(format_args!("::<{0}>", __binding_1))
                                });
                        let __code_18 =
                            ::alloc::__export::must_use({
                                    ::alloc::fmt::format(format_args!("{0}", __binding_2))
                                });
                        suggestions.push((__binding_0, __code_17));
                        suggestions.push((__binding_3, __code_18));
                        let mut sub_args = rustc_errors::DiagArgMap::default();
                        sub_args.insert("const_args".into(),
                            rustc_errors::IntoDiagArg::into_diag_arg(__binding_1,
                                &mut diag.long_ty_path));
                        sub_args.insert("other_args".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("try using a const generic argument instead")),
                                &sub_args);
                        diag.multipart_suggestion_with_style(__message, suggestions,
                            rustc_errors::Applicability::MaybeIncorrect,
                            rustc_errors::SuggestionStyle::ShowCode);
                    }
                }
            }
        }
    };Subdiagnostic)]
505#[multipart_suggestion(
506    "try using a const generic argument instead",
507    applicability = "maybe-incorrect"
508)]
509pub(crate) struct UseConstGenericArg {
510    #[suggestion_part(code = "::<{const_args}>")]
511    pub end_of_fn: Span,
512    pub const_args: String,
513    pub other_args: String,
514    #[suggestion_part(code = "{other_args}")]
515    pub call_args: Span,
516}
517
518#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            UnionWithDefault where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    UnionWithDefault { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("unions cannot have default field values")));
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
519#[diag("unions cannot have default field values")]
520pub(crate) struct UnionWithDefault {
521    #[primary_span]
522    pub span: Span,
523}
524
525#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            UnresolvedDelegationCallee where
            G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    UnresolvedDelegationCallee { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("failed to resolve delegation callee")));
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
526#[diag("failed to resolve delegation callee")]
527pub(crate) struct UnresolvedDelegationCallee {
528    #[primary_span]
529    pub span: Span,
530}
531
532#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            CycleInDelegationSignatureResolution where
            G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    CycleInDelegationSignatureResolution { span: __binding_0 }
                        => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("encountered a cycle during delegation signature resolution")));
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
533#[diag("encountered a cycle during delegation signature resolution")]
534pub(crate) struct CycleInDelegationSignatureResolution {
535    #[primary_span]
536    pub span: Span,
537}