Skip to main content

rustc_codegen_ssa/
errors.rs

1//! Errors emitted by codegen_ssa
2
3use std::borrow::Cow;
4use std::ffi::OsString;
5use std::io::Error;
6use std::path::{Path, PathBuf};
7use std::process::ExitStatus;
8
9use rustc_errors::codes::*;
10use rustc_errors::{
11    Diag, DiagArgValue, DiagCtxtHandle, Diagnostic, EmissionGuarantee, IntoDiagArg, Level,
12};
13use rustc_macros::{Diagnostic, LintDiagnostic, Subdiagnostic};
14use rustc_middle::ty::layout::LayoutError;
15use rustc_middle::ty::{FloatTy, Ty};
16use rustc_span::{Span, Symbol};
17
18use crate::assert_module_sources::CguReuse;
19use crate::back::command::Command;
20use crate::fluent_generated as fluent;
21
22#[derive(const _: () =
    {
        impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
            IncorrectCguReuseType<'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 {
                    IncorrectCguReuseType {
                        span: __binding_0,
                        cgu_user_name: __binding_1,
                        actual_reuse: __binding_2,
                        expected_reuse: __binding_3,
                        at_least: __binding_4 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_incorrect_cgu_reuse_type);
                        ;
                        diag.arg("cgu_user_name", __binding_1);
                        diag.arg("actual_reuse", __binding_2);
                        diag.arg("expected_reuse", __binding_3);
                        diag.arg("at_least", __binding_4);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
23#[diag(codegen_ssa_incorrect_cgu_reuse_type)]
24pub(crate) struct IncorrectCguReuseType<'a> {
25    #[primary_span]
26    pub span: Span,
27    pub cgu_user_name: &'a str,
28    pub actual_reuse: CguReuse,
29    pub expected_reuse: CguReuse,
30    pub at_least: u8,
31}
32
33#[derive(const _: () =
    {
        impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
            CguNotRecorded<'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 {
                    CguNotRecorded {
                        cgu_user_name: __binding_0, cgu_name: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_cgu_not_recorded);
                        ;
                        diag.arg("cgu_user_name", __binding_0);
                        diag.arg("cgu_name", __binding_1);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
34#[diag(codegen_ssa_cgu_not_recorded)]
35pub(crate) struct CguNotRecorded<'a> {
36    pub cgu_user_name: &'a str,
37    pub cgu_name: &'a str,
38}
39
40#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            UnknownReuseKind where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    UnknownReuseKind { span: __binding_0, kind: __binding_1 } =>
                        {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_unknown_reuse_kind);
                        ;
                        diag.arg("kind", __binding_1);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
41#[diag(codegen_ssa_unknown_reuse_kind)]
42pub(crate) struct UnknownReuseKind {
43    #[primary_span]
44    pub span: Span,
45    pub kind: Symbol,
46}
47
48#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            MissingQueryDepGraph where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    MissingQueryDepGraph { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_missing_query_depgraph);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
49#[diag(codegen_ssa_missing_query_depgraph)]
50pub(crate) struct MissingQueryDepGraph {
51    #[primary_span]
52    pub span: Span,
53}
54
55#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            MalformedCguName where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    MalformedCguName {
                        span: __binding_0,
                        user_path: __binding_1,
                        crate_name: __binding_2 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_malformed_cgu_name);
                        ;
                        diag.arg("user_path", __binding_1);
                        diag.arg("crate_name", __binding_2);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
56#[diag(codegen_ssa_malformed_cgu_name)]
57pub(crate) struct MalformedCguName {
58    #[primary_span]
59    pub span: Span,
60    pub user_path: String,
61    pub crate_name: String,
62}
63
64#[derive(const _: () =
    {
        impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
            NoModuleNamed<'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 {
                    NoModuleNamed {
                        span: __binding_0,
                        user_path: __binding_1,
                        cgu_name: __binding_2,
                        cgu_names: __binding_3 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_no_module_named);
                        ;
                        diag.arg("user_path", __binding_1);
                        diag.arg("cgu_name", __binding_2);
                        diag.arg("cgu_names", __binding_3);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
65#[diag(codegen_ssa_no_module_named)]
66pub(crate) struct NoModuleNamed<'a> {
67    #[primary_span]
68    pub span: Span,
69    pub user_path: &'a str,
70    pub cgu_name: Symbol,
71    pub cgu_names: String,
72}
73
74#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            FieldAssociatedValueExpected where
            G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    FieldAssociatedValueExpected {
                        span: __binding_0, name: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_field_associated_value_expected);
                        ;
                        diag.arg("name", __binding_1);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
75#[diag(codegen_ssa_field_associated_value_expected)]
76pub(crate) struct FieldAssociatedValueExpected {
77    #[primary_span]
78    pub span: Span,
79    pub name: Symbol,
80}
81
82#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for NoField where
            G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    NoField { span: __binding_0, name: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_no_field);
                        ;
                        diag.arg("name", __binding_1);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
83#[diag(codegen_ssa_no_field)]
84pub(crate) struct NoField {
85    #[primary_span]
86    pub span: Span,
87    pub name: Symbol,
88}
89
90#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            LibDefWriteFailure where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    LibDefWriteFailure { error: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_lib_def_write_failure);
                        ;
                        diag.arg("error", __binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
91#[diag(codegen_ssa_lib_def_write_failure)]
92pub(crate) struct LibDefWriteFailure {
93    pub error: Error,
94}
95
96#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            VersionScriptWriteFailure where G: rustc_errors::EmissionGuarantee
            {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    VersionScriptWriteFailure { error: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_version_script_write_failure);
                        ;
                        diag.arg("error", __binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
97#[diag(codegen_ssa_version_script_write_failure)]
98pub(crate) struct VersionScriptWriteFailure {
99    pub error: Error,
100}
101
102#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            SymbolFileWriteFailure where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    SymbolFileWriteFailure { error: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_symbol_file_write_failure);
                        ;
                        diag.arg("error", __binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
103#[diag(codegen_ssa_symbol_file_write_failure)]
104pub(crate) struct SymbolFileWriteFailure {
105    pub error: Error,
106}
107
108#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            Ld64UnimplementedModifier where G: rustc_errors::EmissionGuarantee
            {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    Ld64UnimplementedModifier => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_ld64_unimplemented_modifier);
                        ;
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
109#[diag(codegen_ssa_ld64_unimplemented_modifier)]
110pub(crate) struct Ld64UnimplementedModifier;
111
112#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            LinkerUnsupportedModifier where G: rustc_errors::EmissionGuarantee
            {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    LinkerUnsupportedModifier => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_linker_unsupported_modifier);
                        ;
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
113#[diag(codegen_ssa_linker_unsupported_modifier)]
114pub(crate) struct LinkerUnsupportedModifier;
115
116#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            L4BenderExportingSymbolsUnimplemented where
            G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    L4BenderExportingSymbolsUnimplemented => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_L4Bender_exporting_symbols_unimplemented);
                        ;
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
117#[diag(codegen_ssa_L4Bender_exporting_symbols_unimplemented)]
118pub(crate) struct L4BenderExportingSymbolsUnimplemented;
119
120#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            NoNatvisDirectory where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    NoNatvisDirectory { error: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_no_natvis_directory);
                        ;
                        diag.arg("error", __binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
121#[diag(codegen_ssa_no_natvis_directory)]
122pub(crate) struct NoNatvisDirectory {
123    pub error: Error,
124}
125
126#[derive(const _: () =
    {
        impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
            NoSavedObjectFile<'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 {
                    NoSavedObjectFile { cgu_name: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_no_saved_object_file);
                        ;
                        diag.arg("cgu_name", __binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
127#[diag(codegen_ssa_no_saved_object_file)]
128pub(crate) struct NoSavedObjectFile<'a> {
129    pub cgu_name: &'a str,
130}
131
132#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            RequiresRustAbi where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    RequiresRustAbi { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_requires_rust_abi);
                        diag.code(E0737);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
133#[diag(codegen_ssa_requires_rust_abi, code = E0737)]
134pub(crate) struct RequiresRustAbi {
135    #[primary_span]
136    pub span: Span,
137}
138
139#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for CopyPathBuf
            where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    CopyPathBuf {
                        source_file: __binding_0,
                        output_path: __binding_1,
                        error: __binding_2 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_copy_path_buf);
                        ;
                        diag.arg("source_file", __binding_0);
                        diag.arg("output_path", __binding_1);
                        diag.arg("error", __binding_2);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
140#[diag(codegen_ssa_copy_path_buf)]
141pub(crate) struct CopyPathBuf {
142    pub source_file: PathBuf,
143    pub output_path: PathBuf,
144    pub error: Error,
145}
146
147// Reports Paths using `Debug` implementation rather than Path's `Display` implementation.
148#[derive(const _: () =
    {
        impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
            CopyPath<'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 {
                    CopyPath {
                        from: __binding_0, to: __binding_1, error: __binding_2 } =>
                        {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_copy_path);
                        ;
                        diag.arg("from", __binding_0);
                        diag.arg("to", __binding_1);
                        diag.arg("error", __binding_2);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
149#[diag(codegen_ssa_copy_path)]
150pub struct CopyPath<'a> {
151    from: DebugArgPath<'a>,
152    to: DebugArgPath<'a>,
153    error: Error,
154}
155
156impl<'a> CopyPath<'a> {
157    pub fn new(from: &'a Path, to: &'a Path, error: Error) -> CopyPath<'a> {
158        CopyPath { from: DebugArgPath(from), to: DebugArgPath(to), error }
159    }
160}
161
162struct DebugArgPath<'a>(pub &'a Path);
163
164impl IntoDiagArg for DebugArgPath<'_> {
165    fn into_diag_arg(self, _: &mut Option<std::path::PathBuf>) -> rustc_errors::DiagArgValue {
166        DiagArgValue::Str(Cow::Owned(::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("{0:?}", self.0))
    })format!("{:?}", self.0)))
167    }
168}
169
170#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            BinaryOutputToTty where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    BinaryOutputToTty { shorthand: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_binary_output_to_tty);
                        ;
                        diag.arg("shorthand", __binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
171#[diag(codegen_ssa_binary_output_to_tty)]
172pub struct BinaryOutputToTty {
173    pub shorthand: &'static str,
174}
175
176#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            IgnoringEmitPath where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    IgnoringEmitPath { extension: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_ignoring_emit_path);
                        ;
                        diag.arg("extension", __binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
177#[diag(codegen_ssa_ignoring_emit_path)]
178pub struct IgnoringEmitPath {
179    pub extension: &'static str,
180}
181
182#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for IgnoringOutput
            where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    IgnoringOutput { extension: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_ignoring_output);
                        ;
                        diag.arg("extension", __binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
183#[diag(codegen_ssa_ignoring_output)]
184pub struct IgnoringOutput {
185    pub extension: &'static str,
186}
187
188#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for CreateTempDir
            where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    CreateTempDir { error: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_create_temp_dir);
                        ;
                        diag.arg("error", __binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
189#[diag(codegen_ssa_create_temp_dir)]
190pub(crate) struct CreateTempDir {
191    pub error: Error,
192}
193
194#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            AddNativeLibrary where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    AddNativeLibrary {
                        library_path: __binding_0, error: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_add_native_library);
                        ;
                        diag.arg("library_path", __binding_0);
                        diag.arg("error", __binding_1);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
195#[diag(codegen_ssa_add_native_library)]
196pub(crate) struct AddNativeLibrary {
197    pub library_path: PathBuf,
198    pub error: Error,
199}
200
201#[derive(const _: () =
    {
        impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
            MultipleExternalFuncDecl<'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 {
                    MultipleExternalFuncDecl {
                        span: __binding_0,
                        function: __binding_1,
                        library_name: __binding_2 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_multiple_external_func_decl);
                        ;
                        diag.arg("function", __binding_1);
                        diag.arg("library_name", __binding_2);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
202#[diag(codegen_ssa_multiple_external_func_decl)]
203pub(crate) struct MultipleExternalFuncDecl<'a> {
204    #[primary_span]
205    pub span: Span,
206    pub function: Symbol,
207    pub library_name: &'a str,
208}
209
210#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for LinkRlibError
            where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    LinkRlibError::MissingFormat => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_rlib_missing_format);
                        ;
                        diag
                    }
                    LinkRlibError::OnlyRmetaFound { crate_name: __binding_0 } =>
                        {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_rlib_only_rmeta_found);
                        ;
                        diag.arg("crate_name", __binding_0);
                        diag
                    }
                    LinkRlibError::NotFound { crate_name: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_rlib_not_found);
                        ;
                        diag.arg("crate_name", __binding_0);
                        diag
                    }
                    LinkRlibError::IncompatibleDependencyFormats {
                        ty1: __binding_0,
                        ty2: __binding_1,
                        list1: __binding_2,
                        list2: __binding_3 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_rlib_incompatible_dependency_formats);
                        ;
                        diag.arg("ty1", __binding_0);
                        diag.arg("ty2", __binding_1);
                        diag.arg("list1", __binding_2);
                        diag.arg("list2", __binding_3);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
211pub enum LinkRlibError {
212    #[diag(codegen_ssa_rlib_missing_format)]
213    MissingFormat,
214
215    #[diag(codegen_ssa_rlib_only_rmeta_found)]
216    OnlyRmetaFound { crate_name: Symbol },
217
218    #[diag(codegen_ssa_rlib_not_found)]
219    NotFound { crate_name: Symbol },
220
221    #[diag(codegen_ssa_rlib_incompatible_dependency_formats)]
222    IncompatibleDependencyFormats { ty1: String, ty2: String, list1: String, list2: String },
223}
224
225pub(crate) struct ThorinErrorWrapper(pub thorin::Error);
226
227impl<G: EmissionGuarantee> Diagnostic<'_, G> for ThorinErrorWrapper {
228    fn into_diag(self, dcx: DiagCtxtHandle<'_>, level: Level) -> Diag<'_, G> {
229        let build = |msg| Diag::new(dcx, level, msg);
230        match self.0 {
231            thorin::Error::ReadInput(_) => build(fluent::codegen_ssa_thorin_read_input_failure),
232            thorin::Error::ParseFileKind(_) => {
233                build(fluent::codegen_ssa_thorin_parse_input_file_kind)
234            }
235            thorin::Error::ParseObjectFile(_) => {
236                build(fluent::codegen_ssa_thorin_parse_input_object_file)
237            }
238            thorin::Error::ParseArchiveFile(_) => {
239                build(fluent::codegen_ssa_thorin_parse_input_archive_file)
240            }
241            thorin::Error::ParseArchiveMember(_) => {
242                build(fluent::codegen_ssa_thorin_parse_archive_member)
243            }
244            thorin::Error::InvalidInputKind => build(fluent::codegen_ssa_thorin_invalid_input_kind),
245            thorin::Error::DecompressData(_) => build(fluent::codegen_ssa_thorin_decompress_data),
246            thorin::Error::NamelessSection(_, offset) => {
247                build(fluent::codegen_ssa_thorin_section_without_name)
248                    .with_arg("offset", ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("0x{0:08x}", offset))
    })format!("0x{offset:08x}"))
249            }
250            thorin::Error::RelocationWithInvalidSymbol(section, offset) => {
251                build(fluent::codegen_ssa_thorin_relocation_with_invalid_symbol)
252                    .with_arg("section", section)
253                    .with_arg("offset", ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("0x{0:08x}", offset))
    })format!("0x{offset:08x}"))
254            }
255            thorin::Error::MultipleRelocations(section, offset) => {
256                build(fluent::codegen_ssa_thorin_multiple_relocations)
257                    .with_arg("section", section)
258                    .with_arg("offset", ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("0x{0:08x}", offset))
    })format!("0x{offset:08x}"))
259            }
260            thorin::Error::UnsupportedRelocation(section, offset) => {
261                build(fluent::codegen_ssa_thorin_unsupported_relocation)
262                    .with_arg("section", section)
263                    .with_arg("offset", ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("0x{0:08x}", offset))
    })format!("0x{offset:08x}"))
264            }
265            thorin::Error::MissingDwoName(id) => build(fluent::codegen_ssa_thorin_missing_dwo_name)
266                .with_arg("id", ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("0x{0:08x}", id))
    })format!("0x{id:08x}")),
267            thorin::Error::NoCompilationUnits => {
268                build(fluent::codegen_ssa_thorin_no_compilation_units)
269            }
270            thorin::Error::NoDie => build(fluent::codegen_ssa_thorin_no_die),
271            thorin::Error::TopLevelDieNotUnit => {
272                build(fluent::codegen_ssa_thorin_top_level_die_not_unit)
273            }
274            thorin::Error::MissingRequiredSection(section) => {
275                build(fluent::codegen_ssa_thorin_missing_required_section)
276                    .with_arg("section", section)
277            }
278            thorin::Error::ParseUnitAbbreviations(_) => {
279                build(fluent::codegen_ssa_thorin_parse_unit_abbreviations)
280            }
281            thorin::Error::ParseUnitAttribute(_) => {
282                build(fluent::codegen_ssa_thorin_parse_unit_attribute)
283            }
284            thorin::Error::ParseUnitHeader(_) => {
285                build(fluent::codegen_ssa_thorin_parse_unit_header)
286            }
287            thorin::Error::ParseUnit(_) => build(fluent::codegen_ssa_thorin_parse_unit),
288            thorin::Error::IncompatibleIndexVersion(section, format, actual) => {
289                build(fluent::codegen_ssa_thorin_incompatible_index_version)
290                    .with_arg("section", section)
291                    .with_arg("actual", actual)
292                    .with_arg("format", format)
293            }
294            thorin::Error::OffsetAtIndex(_, index) => {
295                build(fluent::codegen_ssa_thorin_offset_at_index).with_arg("index", index)
296            }
297            thorin::Error::StrAtOffset(_, offset) => {
298                build(fluent::codegen_ssa_thorin_str_at_offset)
299                    .with_arg("offset", ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("0x{0:08x}", offset))
    })format!("0x{offset:08x}"))
300            }
301            thorin::Error::ParseIndex(_, section) => {
302                build(fluent::codegen_ssa_thorin_parse_index).with_arg("section", section)
303            }
304            thorin::Error::UnitNotInIndex(unit) => {
305                build(fluent::codegen_ssa_thorin_unit_not_in_index)
306                    .with_arg("unit", ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("0x{0:08x}", unit))
    })format!("0x{unit:08x}"))
307            }
308            thorin::Error::RowNotInIndex(_, row) => {
309                build(fluent::codegen_ssa_thorin_row_not_in_index).with_arg("row", row)
310            }
311            thorin::Error::SectionNotInRow => build(fluent::codegen_ssa_thorin_section_not_in_row),
312            thorin::Error::EmptyUnit(unit) => build(fluent::codegen_ssa_thorin_empty_unit)
313                .with_arg("unit", ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("0x{0:08x}", unit))
    })format!("0x{unit:08x}")),
314            thorin::Error::MultipleDebugInfoSection => {
315                build(fluent::codegen_ssa_thorin_multiple_debug_info_section)
316            }
317            thorin::Error::MultipleDebugTypesSection => {
318                build(fluent::codegen_ssa_thorin_multiple_debug_types_section)
319            }
320            thorin::Error::NotSplitUnit => build(fluent::codegen_ssa_thorin_not_split_unit),
321            thorin::Error::DuplicateUnit(unit) => build(fluent::codegen_ssa_thorin_duplicate_unit)
322                .with_arg("unit", ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("0x{0:08x}", unit))
    })format!("0x{unit:08x}")),
323            thorin::Error::MissingReferencedUnit(unit) => {
324                build(fluent::codegen_ssa_thorin_missing_referenced_unit)
325                    .with_arg("unit", ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("0x{0:08x}", unit))
    })format!("0x{unit:08x}"))
326            }
327            thorin::Error::NoOutputObjectCreated => {
328                build(fluent::codegen_ssa_thorin_not_output_object_created)
329            }
330            thorin::Error::MixedInputEncodings => {
331                build(fluent::codegen_ssa_thorin_mixed_input_encodings)
332            }
333            thorin::Error::Io(e) => {
334                build(fluent::codegen_ssa_thorin_io).with_arg("error", ::alloc::__export::must_use({ ::alloc::fmt::format(format_args!("{0}", e)) })format!("{e}"))
335            }
336            thorin::Error::ObjectRead(e) => {
337                build(fluent::codegen_ssa_thorin_object_read).with_arg("error", ::alloc::__export::must_use({ ::alloc::fmt::format(format_args!("{0}", e)) })format!("{e}"))
338            }
339            thorin::Error::ObjectWrite(e) => {
340                build(fluent::codegen_ssa_thorin_object_write).with_arg("error", ::alloc::__export::must_use({ ::alloc::fmt::format(format_args!("{0}", e)) })format!("{e}"))
341            }
342            thorin::Error::GimliRead(e) => {
343                build(fluent::codegen_ssa_thorin_gimli_read).with_arg("error", ::alloc::__export::must_use({ ::alloc::fmt::format(format_args!("{0}", e)) })format!("{e}"))
344            }
345            thorin::Error::GimliWrite(e) => {
346                build(fluent::codegen_ssa_thorin_gimli_write).with_arg("error", ::alloc::__export::must_use({ ::alloc::fmt::format(format_args!("{0}", e)) })format!("{e}"))
347            }
348            _ => {
    ::core::panicking::panic_fmt(format_args!("not implemented: {0}",
            format_args!("Untranslated thorin error")));
}unimplemented!("Untranslated thorin error"),
349        }
350    }
351}
352
353pub(crate) struct LinkingFailed<'a> {
354    pub linker_path: &'a Path,
355    pub exit_status: ExitStatus,
356    pub command: Command,
357    pub escaped_output: String,
358    pub verbose: bool,
359    pub sysroot_dir: PathBuf,
360}
361
362impl<G: EmissionGuarantee> Diagnostic<'_, G> for LinkingFailed<'_> {
363    fn into_diag(mut self, dcx: DiagCtxtHandle<'_>, level: Level) -> Diag<'_, G> {
364        let mut diag = Diag::new(dcx, level, fluent::codegen_ssa_linking_failed);
365        diag.arg("linker_path", ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("{0}", self.linker_path.display()))
    })format!("{}", self.linker_path.display()));
366        diag.arg("exit_status", ::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("{0}", self.exit_status))
    })format!("{}", self.exit_status));
367
368        let contains_undefined_ref = self.escaped_output.contains("undefined reference to");
369
370        if self.verbose {
371            diag.note(::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("{0:?}", self.command))
    })format!("{:?}", self.command));
372        } else {
373            self.command.env_clear();
374
375            enum ArgGroup {
376                Regular(OsString),
377                Objects(usize),
378                Rlibs(PathBuf, Vec<OsString>),
379            }
380
381            // Omit rust object files and fold rlibs in the error by default to make linker errors a
382            // bit less verbose.
383            let orig_args = self.command.take_args();
384            let mut args: Vec<ArgGroup> = ::alloc::vec::Vec::new()vec![];
385            for arg in orig_args {
386                if arg.as_encoded_bytes().ends_with(b".rcgu.o") {
387                    if let Some(ArgGroup::Objects(n)) = args.last_mut() {
388                        *n += 1;
389                    } else {
390                        args.push(ArgGroup::Objects(1));
391                    }
392                } else if arg.as_encoded_bytes().ends_with(b".rlib") {
393                    let rlib_path = Path::new(&arg);
394                    let dir = rlib_path.parent().unwrap();
395                    let filename = rlib_path.file_stem().unwrap().to_owned();
396                    if let Some(ArgGroup::Rlibs(parent, rlibs)) = args.last_mut() {
397                        if parent == dir {
398                            rlibs.push(filename);
399                        } else {
400                            args.push(ArgGroup::Rlibs(dir.to_owned(), <[_]>::into_vec(::alloc::boxed::box_new([filename]))vec![filename]));
401                        }
402                    } else {
403                        args.push(ArgGroup::Rlibs(dir.to_owned(), <[_]>::into_vec(::alloc::boxed::box_new([filename]))vec![filename]));
404                    }
405                } else {
406                    args.push(ArgGroup::Regular(arg));
407                }
408            }
409            let crate_hash = regex::bytes::Regex::new(r"-[0-9a-f]+").unwrap();
410            self.command.args(args.into_iter().map(|arg_group| {
411                match arg_group {
412                    // SAFETY: we are only matching on ASCII, not any surrogate pairs, so any replacements we do will still be valid.
413                    ArgGroup::Regular(arg) => unsafe {
414                        use bstr::ByteSlice;
415                        OsString::from_encoded_bytes_unchecked(
416                            arg.as_encoded_bytes().replace(
417                                self.sysroot_dir.as_os_str().as_encoded_bytes(),
418                                b"<sysroot>",
419                            ),
420                        )
421                    },
422                    ArgGroup::Objects(n) => OsString::from(::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("<{0} object files omitted>", n))
    })format!("<{n} object files omitted>")),
423                    ArgGroup::Rlibs(mut dir, rlibs) => {
424                        let is_sysroot_dir = match dir.strip_prefix(&self.sysroot_dir) {
425                            Ok(short) => {
426                                dir = Path::new("<sysroot>").join(short);
427                                true
428                            }
429                            Err(_) => false,
430                        };
431                        let mut arg = dir.into_os_string();
432                        arg.push("/");
433                        let needs_braces = rlibs.len() >= 2;
434                        if needs_braces {
435                            arg.push("{");
436                        }
437                        let mut first = true;
438                        for mut rlib in rlibs {
439                            if !first {
440                                arg.push(",");
441                            }
442                            first = false;
443                            if is_sysroot_dir {
444                                // SAFETY: Regex works one byte at a type, and our regex will not match surrogate pairs (because it only matches ascii).
445                                rlib = unsafe {
446                                    OsString::from_encoded_bytes_unchecked(
447                                        crate_hash
448                                            .replace(rlib.as_encoded_bytes(), b"-*")
449                                            .into_owned(),
450                                    )
451                                };
452                            }
453                            arg.push(rlib);
454                        }
455                        if needs_braces {
456                            arg.push("}");
457                        }
458                        arg.push(".rlib");
459                        arg
460                    }
461                }
462            }));
463
464            diag.note(::alloc::__export::must_use({
        ::alloc::fmt::format(format_args!("{0:?}", self.command))
    })format!("{:?}", self.command).trim_start_matches("env -i").to_owned());
465            diag.note("some arguments are omitted. use `--verbose` to show all linker arguments");
466        }
467
468        diag.note(self.escaped_output);
469
470        // Trying to match an error from OS linkers
471        // which by now we have no way to translate.
472        if contains_undefined_ref {
473            diag.note(fluent::codegen_ssa_extern_funcs_not_found)
474                .note(fluent::codegen_ssa_specify_libraries_to_link);
475
476            if rustc_session::utils::was_invoked_from_cargo() {
477                diag.note(fluent::codegen_ssa_use_cargo_directive);
478            }
479        }
480        diag
481    }
482}
483
484#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            LinkExeUnexpectedError where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    LinkExeUnexpectedError => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_link_exe_unexpected_error);
                        ;
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
485#[diag(codegen_ssa_link_exe_unexpected_error)]
486pub(crate) struct LinkExeUnexpectedError;
487
488pub(crate) struct LinkExeStatusStackBufferOverrun;
489
490impl<'a, G: EmissionGuarantee> Diagnostic<'a, G> for LinkExeStatusStackBufferOverrun {
491    fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'a>, level: Level) -> Diag<'a, G> {
492        let mut diag =
493            Diag::new(dcx, level, fluent::codegen_ssa_link_exe_status_stack_buffer_overrun);
494        diag.note(fluent::codegen_ssa_abort_note);
495        diag.note(fluent::codegen_ssa_event_log_note);
496        diag
497    }
498}
499
500#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            RepairVSBuildTools where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    RepairVSBuildTools => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_repair_vs_build_tools);
                        ;
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
501#[diag(codegen_ssa_repair_vs_build_tools)]
502pub(crate) struct RepairVSBuildTools;
503
504#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            MissingCppBuildToolComponent where
            G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    MissingCppBuildToolComponent => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_missing_cpp_build_tool_component);
                        ;
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
505#[diag(codegen_ssa_missing_cpp_build_tool_component)]
506pub(crate) struct MissingCppBuildToolComponent;
507
508#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            SelectCppBuildToolWorkload where
            G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    SelectCppBuildToolWorkload => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_select_cpp_build_tool_workload);
                        ;
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
509#[diag(codegen_ssa_select_cpp_build_tool_workload)]
510pub(crate) struct SelectCppBuildToolWorkload;
511
512#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            VisualStudioNotInstalled where G: rustc_errors::EmissionGuarantee
            {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    VisualStudioNotInstalled => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_visual_studio_not_installed);
                        ;
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
513#[diag(codegen_ssa_visual_studio_not_installed)]
514pub(crate) struct VisualStudioNotInstalled;
515
516#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for LinkerNotFound
            where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    LinkerNotFound {
                        linker_path: __binding_0, error: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_linker_not_found);
                        diag.note(crate::fluent_generated::_subdiag::note);
                        ;
                        diag.arg("linker_path", __binding_0);
                        diag.arg("error", __binding_1);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
517#[diag(codegen_ssa_linker_not_found)]
518#[note]
519pub(crate) struct LinkerNotFound {
520    pub linker_path: PathBuf,
521    pub error: Error,
522}
523
524#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            UnableToExeLinker where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    UnableToExeLinker {
                        linker_path: __binding_0,
                        error: __binding_1,
                        command_formatted: __binding_2 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_unable_to_exe_linker);
                        diag.note(crate::fluent_generated::_subdiag::note);
                        diag.note(crate::fluent_generated::codegen_ssa_command_note);
                        ;
                        diag.arg("linker_path", __binding_0);
                        diag.arg("error", __binding_1);
                        diag.arg("command_formatted", __binding_2);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
525#[diag(codegen_ssa_unable_to_exe_linker)]
526#[note]
527#[note(codegen_ssa_command_note)]
528pub(crate) struct UnableToExeLinker {
529    pub linker_path: PathBuf,
530    pub error: Error,
531    pub command_formatted: String,
532}
533
534#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            MsvcMissingLinker where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    MsvcMissingLinker => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_msvc_missing_linker);
                        ;
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
535#[diag(codegen_ssa_msvc_missing_linker)]
536pub(crate) struct MsvcMissingLinker;
537
538#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            SelfContainedLinkerMissing where
            G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    SelfContainedLinkerMissing => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_self_contained_linker_missing);
                        ;
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
539#[diag(codegen_ssa_self_contained_linker_missing)]
540pub(crate) struct SelfContainedLinkerMissing;
541
542#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            CheckInstalledVisualStudio where
            G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    CheckInstalledVisualStudio => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_check_installed_visual_studio);
                        ;
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
543#[diag(codegen_ssa_check_installed_visual_studio)]
544pub(crate) struct CheckInstalledVisualStudio;
545
546#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            InsufficientVSCodeProduct where G: rustc_errors::EmissionGuarantee
            {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    InsufficientVSCodeProduct => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_insufficient_vs_code_product);
                        ;
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
547#[diag(codegen_ssa_insufficient_vs_code_product)]
548pub(crate) struct InsufficientVSCodeProduct;
549
550#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for CpuRequired
            where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    CpuRequired => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_cpu_required);
                        ;
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
551#[diag(codegen_ssa_cpu_required)]
552pub(crate) struct CpuRequired;
553
554#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            ProcessingDymutilFailed where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    ProcessingDymutilFailed {
                        status: __binding_0, output: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_processing_dymutil_failed);
                        diag.note(crate::fluent_generated::_subdiag::note);
                        ;
                        diag.arg("status", __binding_0);
                        diag.arg("output", __binding_1);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
555#[diag(codegen_ssa_processing_dymutil_failed)]
556#[note]
557pub(crate) struct ProcessingDymutilFailed {
558    pub status: ExitStatus,
559    pub output: String,
560}
561
562#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            UnableToRunDsymutil where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    UnableToRunDsymutil { error: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_unable_to_run_dsymutil);
                        ;
                        diag.arg("error", __binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
563#[diag(codegen_ssa_unable_to_run_dsymutil)]
564pub(crate) struct UnableToRunDsymutil {
565    pub error: Error,
566}
567
568#[derive(const _: () =
    {
        impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
            StrippingDebugInfoFailed<'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 {
                    StrippingDebugInfoFailed {
                        util: __binding_0, status: __binding_1, output: __binding_2
                        } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_stripping_debug_info_failed);
                        diag.note(crate::fluent_generated::_subdiag::note);
                        ;
                        diag.arg("util", __binding_0);
                        diag.arg("status", __binding_1);
                        diag.arg("output", __binding_2);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
569#[diag(codegen_ssa_stripping_debug_info_failed)]
570#[note]
571pub(crate) struct StrippingDebugInfoFailed<'a> {
572    pub util: &'a str,
573    pub status: ExitStatus,
574    pub output: String,
575}
576
577#[derive(const _: () =
    {
        impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
            UnableToRun<'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 {
                    UnableToRun { util: __binding_0, error: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_unable_to_run);
                        ;
                        diag.arg("util", __binding_0);
                        diag.arg("error", __binding_1);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
578#[diag(codegen_ssa_unable_to_run)]
579pub(crate) struct UnableToRun<'a> {
580    pub util: &'a str,
581    pub error: Error,
582}
583
584#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for LinkerFileStem
            where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    LinkerFileStem => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_linker_file_stem);
                        ;
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
585#[diag(codegen_ssa_linker_file_stem)]
586pub(crate) struct LinkerFileStem;
587
588#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            StaticLibraryNativeArtifacts where
            G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    StaticLibraryNativeArtifacts => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_static_library_native_artifacts);
                        ;
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
589#[diag(codegen_ssa_static_library_native_artifacts)]
590pub(crate) struct StaticLibraryNativeArtifacts;
591
592#[derive(const _: () =
    {
        impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
            StaticLibraryNativeArtifactsToFile<'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 {
                    StaticLibraryNativeArtifactsToFile { path: __binding_0 } =>
                        {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_static_library_native_artifacts_to_file);
                        ;
                        diag.arg("path", __binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
593#[diag(codegen_ssa_static_library_native_artifacts_to_file)]
594pub(crate) struct StaticLibraryNativeArtifactsToFile<'a> {
595    pub path: &'a Path,
596}
597
598#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            LinkScriptUnavailable where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    LinkScriptUnavailable => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_link_script_unavailable);
                        ;
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
599#[diag(codegen_ssa_link_script_unavailable)]
600pub(crate) struct LinkScriptUnavailable;
601
602#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            LinkScriptWriteFailure where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    LinkScriptWriteFailure {
                        path: __binding_0, error: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_link_script_write_failure);
                        ;
                        diag.arg("path", __binding_0);
                        diag.arg("error", __binding_1);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
603#[diag(codegen_ssa_link_script_write_failure)]
604pub(crate) struct LinkScriptWriteFailure {
605    pub path: PathBuf,
606    pub error: Error,
607}
608
609#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for FailedToWrite
            where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    FailedToWrite { path: __binding_0, error: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_failed_to_write);
                        ;
                        diag.arg("path", __binding_0);
                        diag.arg("error", __binding_1);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
610#[diag(codegen_ssa_failed_to_write)]
611pub(crate) struct FailedToWrite {
612    pub path: PathBuf,
613    pub error: Error,
614}
615
616#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            UnableToWriteDebuggerVisualizer where
            G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    UnableToWriteDebuggerVisualizer {
                        path: __binding_0, error: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_unable_to_write_debugger_visualizer);
                        ;
                        diag.arg("path", __binding_0);
                        diag.arg("error", __binding_1);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
617#[diag(codegen_ssa_unable_to_write_debugger_visualizer)]
618pub(crate) struct UnableToWriteDebuggerVisualizer {
619    pub path: PathBuf,
620    pub error: Error,
621}
622
623#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            RlibArchiveBuildFailure where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    RlibArchiveBuildFailure {
                        path: __binding_0, error: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_rlib_archive_build_failure);
                        ;
                        diag.arg("path", __binding_0);
                        diag.arg("error", __binding_1);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
624#[diag(codegen_ssa_rlib_archive_build_failure)]
625pub(crate) struct RlibArchiveBuildFailure {
626    pub path: PathBuf,
627    pub error: Error,
628}
629
630#[derive(const _: () =
    {
        impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
            ExtractBundledLibsError<'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 {
                    ExtractBundledLibsError::OpenFile {
                        rlib: __binding_0, error: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_extract_bundled_libs_open_file);
                        ;
                        diag.arg("rlib", __binding_0);
                        diag.arg("error", __binding_1);
                        diag
                    }
                    ExtractBundledLibsError::MmapFile {
                        rlib: __binding_0, error: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_extract_bundled_libs_mmap_file);
                        ;
                        diag.arg("rlib", __binding_0);
                        diag.arg("error", __binding_1);
                        diag
                    }
                    ExtractBundledLibsError::ParseArchive {
                        rlib: __binding_0, error: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_extract_bundled_libs_parse_archive);
                        ;
                        diag.arg("rlib", __binding_0);
                        diag.arg("error", __binding_1);
                        diag
                    }
                    ExtractBundledLibsError::ReadEntry {
                        rlib: __binding_0, error: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_extract_bundled_libs_read_entry);
                        ;
                        diag.arg("rlib", __binding_0);
                        diag.arg("error", __binding_1);
                        diag
                    }
                    ExtractBundledLibsError::ArchiveMember {
                        rlib: __binding_0, error: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_extract_bundled_libs_archive_member);
                        ;
                        diag.arg("rlib", __binding_0);
                        diag.arg("error", __binding_1);
                        diag
                    }
                    ExtractBundledLibsError::ConvertName {
                        rlib: __binding_0, error: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_extract_bundled_libs_convert_name);
                        ;
                        diag.arg("rlib", __binding_0);
                        diag.arg("error", __binding_1);
                        diag
                    }
                    ExtractBundledLibsError::WriteFile {
                        rlib: __binding_0, error: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_extract_bundled_libs_write_file);
                        ;
                        diag.arg("rlib", __binding_0);
                        diag.arg("error", __binding_1);
                        diag
                    }
                    ExtractBundledLibsError::ExtractSection {
                        rlib: __binding_0, error: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_extract_bundled_libs_write_file);
                        ;
                        diag.arg("rlib", __binding_0);
                        diag.arg("error", __binding_1);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
631// Public for ArchiveBuilderBuilder::extract_bundled_libs
632pub enum ExtractBundledLibsError<'a> {
633    #[diag(codegen_ssa_extract_bundled_libs_open_file)]
634    OpenFile { rlib: &'a Path, error: Box<dyn std::error::Error> },
635
636    #[diag(codegen_ssa_extract_bundled_libs_mmap_file)]
637    MmapFile { rlib: &'a Path, error: Box<dyn std::error::Error> },
638
639    #[diag(codegen_ssa_extract_bundled_libs_parse_archive)]
640    ParseArchive { rlib: &'a Path, error: Box<dyn std::error::Error> },
641
642    #[diag(codegen_ssa_extract_bundled_libs_read_entry)]
643    ReadEntry { rlib: &'a Path, error: Box<dyn std::error::Error> },
644
645    #[diag(codegen_ssa_extract_bundled_libs_archive_member)]
646    ArchiveMember { rlib: &'a Path, error: Box<dyn std::error::Error> },
647
648    #[diag(codegen_ssa_extract_bundled_libs_convert_name)]
649    ConvertName { rlib: &'a Path, error: Box<dyn std::error::Error> },
650
651    #[diag(codegen_ssa_extract_bundled_libs_write_file)]
652    WriteFile { rlib: &'a Path, error: Box<dyn std::error::Error> },
653
654    #[diag(codegen_ssa_extract_bundled_libs_write_file)]
655    ExtractSection { rlib: &'a Path, error: Box<dyn std::error::Error> },
656}
657
658#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for ReadFileError
            where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    ReadFileError { message: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_read_file);
                        ;
                        diag.arg("message", __binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
659#[diag(codegen_ssa_read_file)]
660pub(crate) struct ReadFileError {
661    pub message: std::io::Error,
662}
663
664#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            UnsupportedLinkSelfContained where
            G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    UnsupportedLinkSelfContained => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_unsupported_link_self_contained);
                        ;
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
665#[diag(codegen_ssa_unsupported_link_self_contained)]
666pub(crate) struct UnsupportedLinkSelfContained;
667
668#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            ArchiveBuildFailure where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    ArchiveBuildFailure { path: __binding_0, error: __binding_1
                        } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_archive_build_failure);
                        ;
                        diag.arg("path", __binding_0);
                        diag.arg("error", __binding_1);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
669#[diag(codegen_ssa_archive_build_failure)]
670pub(crate) struct ArchiveBuildFailure {
671    pub path: PathBuf,
672    pub error: std::io::Error,
673}
674
675#[derive(const _: () =
    {
        impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
            UnknownArchiveKind<'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 {
                    UnknownArchiveKind { kind: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_unknown_archive_kind);
                        ;
                        diag.arg("kind", __binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
676#[diag(codegen_ssa_unknown_archive_kind)]
677pub(crate) struct UnknownArchiveKind<'a> {
678    pub kind: &'a str,
679}
680
681#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            BpfStaticlibNotSupported where G: rustc_errors::EmissionGuarantee
            {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    BpfStaticlibNotSupported => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_bpf_staticlib_not_supported);
                        ;
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
682#[diag(codegen_ssa_bpf_staticlib_not_supported)]
683pub(crate) struct BpfStaticlibNotSupported;
684
685#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            MultipleMainFunctions where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    MultipleMainFunctions { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_multiple_main_functions);
                        diag.help(crate::fluent_generated::_subdiag::help);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
686#[diag(codegen_ssa_multiple_main_functions)]
687#[help]
688pub(crate) struct MultipleMainFunctions {
689    #[primary_span]
690    pub span: Span,
691}
692
693#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            ShuffleIndicesEvaluation where G: rustc_errors::EmissionGuarantee
            {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    ShuffleIndicesEvaluation { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_shuffle_indices_evaluation);
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
694#[diag(codegen_ssa_shuffle_indices_evaluation)]
695pub(crate) struct ShuffleIndicesEvaluation {
696    #[primary_span]
697    pub span: Span,
698}
699
700#[derive(const _: () =
    {
        impl<'_sess, 'tcx, G> rustc_errors::Diagnostic<'_sess, G> for
            InvalidMonomorphization<'tcx> where
            G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    InvalidMonomorphization::BasicIntegerType {
                        span: __binding_0, name: __binding_1, ty: __binding_2 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_invalid_monomorphization_basic_integer_type);
                        diag.code(E0511);
                        ;
                        diag.arg("name", __binding_1);
                        diag.arg("ty", __binding_2);
                        diag.span(__binding_0);
                        diag
                    }
                    InvalidMonomorphization::BasicIntegerOrPtrType {
                        span: __binding_0, name: __binding_1, ty: __binding_2 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_invalid_monomorphization_basic_integer_or_ptr_type);
                        diag.code(E0511);
                        ;
                        diag.arg("name", __binding_1);
                        diag.arg("ty", __binding_2);
                        diag.span(__binding_0);
                        diag
                    }
                    InvalidMonomorphization::BasicFloatType {
                        span: __binding_0, name: __binding_1, ty: __binding_2 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_invalid_monomorphization_basic_float_type);
                        diag.code(E0511);
                        ;
                        diag.arg("name", __binding_1);
                        diag.arg("ty", __binding_2);
                        diag.span(__binding_0);
                        diag
                    }
                    InvalidMonomorphization::FloatToIntUnchecked {
                        span: __binding_0, ty: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_invalid_monomorphization_float_to_int_unchecked);
                        diag.code(E0511);
                        ;
                        diag.arg("ty", __binding_1);
                        diag.span(__binding_0);
                        diag
                    }
                    InvalidMonomorphization::FloatingPointVector {
                        span: __binding_0,
                        name: __binding_1,
                        f_ty: __binding_2,
                        in_ty: __binding_3 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_invalid_monomorphization_floating_point_vector);
                        diag.code(E0511);
                        ;
                        diag.arg("name", __binding_1);
                        diag.arg("f_ty", __binding_2);
                        diag.arg("in_ty", __binding_3);
                        diag.span(__binding_0);
                        diag
                    }
                    InvalidMonomorphization::FloatingPointType {
                        span: __binding_0, name: __binding_1, in_ty: __binding_2 }
                        => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_invalid_monomorphization_floating_point_type);
                        diag.code(E0511);
                        ;
                        diag.arg("name", __binding_1);
                        diag.arg("in_ty", __binding_2);
                        diag.span(__binding_0);
                        diag
                    }
                    InvalidMonomorphization::UnrecognizedIntrinsic {
                        span: __binding_0, name: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_invalid_monomorphization_unrecognized_intrinsic);
                        diag.code(E0511);
                        ;
                        diag.arg("name", __binding_1);
                        diag.span(__binding_0);
                        diag
                    }
                    InvalidMonomorphization::SimdArgument {
                        span: __binding_0, name: __binding_1, ty: __binding_2 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_invalid_monomorphization_simd_argument);
                        diag.code(E0511);
                        ;
                        diag.arg("name", __binding_1);
                        diag.arg("ty", __binding_2);
                        diag.span(__binding_0);
                        diag
                    }
                    InvalidMonomorphization::SimdInput {
                        span: __binding_0, name: __binding_1, ty: __binding_2 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_invalid_monomorphization_simd_input);
                        diag.code(E0511);
                        ;
                        diag.arg("name", __binding_1);
                        diag.arg("ty", __binding_2);
                        diag.span(__binding_0);
                        diag
                    }
                    InvalidMonomorphization::SimdFirst {
                        span: __binding_0, name: __binding_1, ty: __binding_2 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_invalid_monomorphization_simd_first);
                        diag.code(E0511);
                        ;
                        diag.arg("name", __binding_1);
                        diag.arg("ty", __binding_2);
                        diag.span(__binding_0);
                        diag
                    }
                    InvalidMonomorphization::SimdSecond {
                        span: __binding_0, name: __binding_1, ty: __binding_2 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_invalid_monomorphization_simd_second);
                        diag.code(E0511);
                        ;
                        diag.arg("name", __binding_1);
                        diag.arg("ty", __binding_2);
                        diag.span(__binding_0);
                        diag
                    }
                    InvalidMonomorphization::SimdThird {
                        span: __binding_0, name: __binding_1, ty: __binding_2 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_invalid_monomorphization_simd_third);
                        diag.code(E0511);
                        ;
                        diag.arg("name", __binding_1);
                        diag.arg("ty", __binding_2);
                        diag.span(__binding_0);
                        diag
                    }
                    InvalidMonomorphization::SimdReturn {
                        span: __binding_0, name: __binding_1, ty: __binding_2 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_invalid_monomorphization_simd_return);
                        diag.code(E0511);
                        ;
                        diag.arg("name", __binding_1);
                        diag.arg("ty", __binding_2);
                        diag.span(__binding_0);
                        diag
                    }
                    InvalidMonomorphization::InvalidBitmask {
                        span: __binding_0,
                        name: __binding_1,
                        mask_ty: __binding_2,
                        expected_int_bits: __binding_3,
                        expected_bytes: __binding_4 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_invalid_monomorphization_invalid_bitmask);
                        diag.code(E0511);
                        ;
                        diag.arg("name", __binding_1);
                        diag.arg("mask_ty", __binding_2);
                        diag.arg("expected_int_bits", __binding_3);
                        diag.arg("expected_bytes", __binding_4);
                        diag.span(__binding_0);
                        diag
                    }
                    InvalidMonomorphization::ReturnLengthInputType {
                        span: __binding_0,
                        name: __binding_1,
                        in_len: __binding_2,
                        in_ty: __binding_3,
                        ret_ty: __binding_4,
                        out_len: __binding_5 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_invalid_monomorphization_return_length_input_type);
                        diag.code(E0511);
                        ;
                        diag.arg("name", __binding_1);
                        diag.arg("in_len", __binding_2);
                        diag.arg("in_ty", __binding_3);
                        diag.arg("ret_ty", __binding_4);
                        diag.arg("out_len", __binding_5);
                        diag.span(__binding_0);
                        diag
                    }
                    InvalidMonomorphization::SecondArgumentLength {
                        span: __binding_0,
                        name: __binding_1,
                        in_len: __binding_2,
                        in_ty: __binding_3,
                        arg_ty: __binding_4,
                        out_len: __binding_5 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_invalid_monomorphization_second_argument_length);
                        diag.code(E0511);
                        ;
                        diag.arg("name", __binding_1);
                        diag.arg("in_len", __binding_2);
                        diag.arg("in_ty", __binding_3);
                        diag.arg("arg_ty", __binding_4);
                        diag.arg("out_len", __binding_5);
                        diag.span(__binding_0);
                        diag
                    }
                    InvalidMonomorphization::ThirdArgumentLength {
                        span: __binding_0,
                        name: __binding_1,
                        in_len: __binding_2,
                        in_ty: __binding_3,
                        arg_ty: __binding_4,
                        out_len: __binding_5 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_invalid_monomorphization_third_argument_length);
                        diag.code(E0511);
                        ;
                        diag.arg("name", __binding_1);
                        diag.arg("in_len", __binding_2);
                        diag.arg("in_ty", __binding_3);
                        diag.arg("arg_ty", __binding_4);
                        diag.arg("out_len", __binding_5);
                        diag.span(__binding_0);
                        diag
                    }
                    InvalidMonomorphization::ReturnIntegerType {
                        span: __binding_0,
                        name: __binding_1,
                        ret_ty: __binding_2,
                        out_ty: __binding_3 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_invalid_monomorphization_return_integer_type);
                        diag.code(E0511);
                        ;
                        diag.arg("name", __binding_1);
                        diag.arg("ret_ty", __binding_2);
                        diag.arg("out_ty", __binding_3);
                        diag.span(__binding_0);
                        diag
                    }
                    InvalidMonomorphization::SimdShuffle {
                        span: __binding_0, name: __binding_1, ty: __binding_2 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_invalid_monomorphization_simd_shuffle);
                        diag.code(E0511);
                        ;
                        diag.arg("name", __binding_1);
                        diag.arg("ty", __binding_2);
                        diag.span(__binding_0);
                        diag
                    }
                    InvalidMonomorphization::ReturnLength {
                        span: __binding_0,
                        name: __binding_1,
                        in_len: __binding_2,
                        ret_ty: __binding_3,
                        out_len: __binding_4 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_invalid_monomorphization_return_length);
                        diag.code(E0511);
                        ;
                        diag.arg("name", __binding_1);
                        diag.arg("in_len", __binding_2);
                        diag.arg("ret_ty", __binding_3);
                        diag.arg("out_len", __binding_4);
                        diag.span(__binding_0);
                        diag
                    }
                    InvalidMonomorphization::ReturnElement {
                        span: __binding_0,
                        name: __binding_1,
                        in_elem: __binding_2,
                        in_ty: __binding_3,
                        ret_ty: __binding_4,
                        out_ty: __binding_5 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_invalid_monomorphization_return_element);
                        diag.code(E0511);
                        ;
                        diag.arg("name", __binding_1);
                        diag.arg("in_elem", __binding_2);
                        diag.arg("in_ty", __binding_3);
                        diag.arg("ret_ty", __binding_4);
                        diag.arg("out_ty", __binding_5);
                        diag.span(__binding_0);
                        diag
                    }
                    InvalidMonomorphization::SimdIndexOutOfBounds {
                        span: __binding_0,
                        name: __binding_1,
                        arg_idx: __binding_2,
                        total_len: __binding_3 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_invalid_monomorphization_simd_index_out_of_bounds);
                        diag.code(E0511);
                        ;
                        diag.arg("name", __binding_1);
                        diag.arg("arg_idx", __binding_2);
                        diag.arg("total_len", __binding_3);
                        diag.span(__binding_0);
                        diag
                    }
                    InvalidMonomorphization::InsertedType {
                        span: __binding_0,
                        name: __binding_1,
                        in_elem: __binding_2,
                        in_ty: __binding_3,
                        out_ty: __binding_4 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_invalid_monomorphization_inserted_type);
                        diag.code(E0511);
                        ;
                        diag.arg("name", __binding_1);
                        diag.arg("in_elem", __binding_2);
                        diag.arg("in_ty", __binding_3);
                        diag.arg("out_ty", __binding_4);
                        diag.span(__binding_0);
                        diag
                    }
                    InvalidMonomorphization::ReturnType {
                        span: __binding_0,
                        name: __binding_1,
                        in_elem: __binding_2,
                        in_ty: __binding_3,
                        ret_ty: __binding_4 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_invalid_monomorphization_return_type);
                        diag.code(E0511);
                        ;
                        diag.arg("name", __binding_1);
                        diag.arg("in_elem", __binding_2);
                        diag.arg("in_ty", __binding_3);
                        diag.arg("ret_ty", __binding_4);
                        diag.span(__binding_0);
                        diag
                    }
                    InvalidMonomorphization::ExpectedReturnType {
                        span: __binding_0,
                        name: __binding_1,
                        in_ty: __binding_2,
                        ret_ty: __binding_3 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_invalid_monomorphization_expected_return_type);
                        diag.code(E0511);
                        ;
                        diag.arg("name", __binding_1);
                        diag.arg("in_ty", __binding_2);
                        diag.arg("ret_ty", __binding_3);
                        diag.span(__binding_0);
                        diag
                    }
                    InvalidMonomorphization::MismatchedLengths {
                        span: __binding_0,
                        name: __binding_1,
                        m_len: __binding_2,
                        v_len: __binding_3 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_invalid_monomorphization_mismatched_lengths);
                        diag.code(E0511);
                        ;
                        diag.arg("name", __binding_1);
                        diag.arg("m_len", __binding_2);
                        diag.arg("v_len", __binding_3);
                        diag.span(__binding_0);
                        diag
                    }
                    InvalidMonomorphization::MaskWrongElementType {
                        span: __binding_0, name: __binding_1, ty: __binding_2 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_invalid_monomorphization_mask_wrong_element_type);
                        diag.code(E0511);
                        ;
                        diag.arg("name", __binding_1);
                        diag.arg("ty", __binding_2);
                        diag.span(__binding_0);
                        diag
                    }
                    InvalidMonomorphization::CannotReturn {
                        span: __binding_0,
                        name: __binding_1,
                        ret_ty: __binding_2,
                        expected_int_bits: __binding_3,
                        expected_bytes: __binding_4 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_invalid_monomorphization_cannot_return);
                        diag.code(E0511);
                        ;
                        diag.arg("name", __binding_1);
                        diag.arg("ret_ty", __binding_2);
                        diag.arg("expected_int_bits", __binding_3);
                        diag.arg("expected_bytes", __binding_4);
                        diag.span(__binding_0);
                        diag
                    }
                    InvalidMonomorphization::ExpectedElementType {
                        span: __binding_0,
                        name: __binding_1,
                        expected_element: __binding_2,
                        second_arg: __binding_3,
                        in_elem: __binding_4,
                        in_ty: __binding_5,
                        mutability: __binding_6 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_invalid_monomorphization_expected_element_type);
                        diag.code(E0511);
                        ;
                        diag.arg("name", __binding_1);
                        diag.arg("expected_element", __binding_2);
                        diag.arg("second_arg", __binding_3);
                        diag.arg("in_elem", __binding_4);
                        diag.arg("in_ty", __binding_5);
                        diag.arg("mutability", __binding_6);
                        diag.span(__binding_0);
                        diag
                    }
                    InvalidMonomorphization::UnsupportedSymbolOfSize {
                        span: __binding_0,
                        name: __binding_1,
                        symbol: __binding_2,
                        in_ty: __binding_3,
                        in_elem: __binding_4,
                        size: __binding_5,
                        ret_ty: __binding_6 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_invalid_monomorphization_unsupported_symbol_of_size);
                        diag.code(E0511);
                        ;
                        diag.arg("name", __binding_1);
                        diag.arg("symbol", __binding_2);
                        diag.arg("in_ty", __binding_3);
                        diag.arg("in_elem", __binding_4);
                        diag.arg("size", __binding_5);
                        diag.arg("ret_ty", __binding_6);
                        diag.span(__binding_0);
                        diag
                    }
                    InvalidMonomorphization::UnsupportedSymbol {
                        span: __binding_0,
                        name: __binding_1,
                        symbol: __binding_2,
                        in_ty: __binding_3,
                        in_elem: __binding_4,
                        ret_ty: __binding_5 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_invalid_monomorphization_unsupported_symbol);
                        diag.code(E0511);
                        ;
                        diag.arg("name", __binding_1);
                        diag.arg("symbol", __binding_2);
                        diag.arg("in_ty", __binding_3);
                        diag.arg("in_elem", __binding_4);
                        diag.arg("ret_ty", __binding_5);
                        diag.span(__binding_0);
                        diag
                    }
                    InvalidMonomorphization::CastWidePointer {
                        span: __binding_0, name: __binding_1, ty: __binding_2 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_invalid_monomorphization_cast_wide_pointer);
                        diag.code(E0511);
                        ;
                        diag.arg("name", __binding_1);
                        diag.arg("ty", __binding_2);
                        diag.span(__binding_0);
                        diag
                    }
                    InvalidMonomorphization::ExpectedPointer {
                        span: __binding_0, name: __binding_1, ty: __binding_2 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_invalid_monomorphization_expected_pointer);
                        diag.code(E0511);
                        ;
                        diag.arg("name", __binding_1);
                        diag.arg("ty", __binding_2);
                        diag.span(__binding_0);
                        diag
                    }
                    InvalidMonomorphization::ExpectedUsize {
                        span: __binding_0, name: __binding_1, ty: __binding_2 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_invalid_monomorphization_expected_usize);
                        diag.code(E0511);
                        ;
                        diag.arg("name", __binding_1);
                        diag.arg("ty", __binding_2);
                        diag.span(__binding_0);
                        diag
                    }
                    InvalidMonomorphization::UnsupportedCast {
                        span: __binding_0,
                        name: __binding_1,
                        in_ty: __binding_2,
                        in_elem: __binding_3,
                        ret_ty: __binding_4,
                        out_elem: __binding_5 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_invalid_monomorphization_unsupported_cast);
                        diag.code(E0511);
                        ;
                        diag.arg("name", __binding_1);
                        diag.arg("in_ty", __binding_2);
                        diag.arg("in_elem", __binding_3);
                        diag.arg("ret_ty", __binding_4);
                        diag.arg("out_elem", __binding_5);
                        diag.span(__binding_0);
                        diag
                    }
                    InvalidMonomorphization::UnsupportedOperation {
                        span: __binding_0,
                        name: __binding_1,
                        in_ty: __binding_2,
                        in_elem: __binding_3 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_invalid_monomorphization_unsupported_operation);
                        diag.code(E0511);
                        ;
                        diag.arg("name", __binding_1);
                        diag.arg("in_ty", __binding_2);
                        diag.arg("in_elem", __binding_3);
                        diag.span(__binding_0);
                        diag
                    }
                    InvalidMonomorphization::ExpectedVectorElementType {
                        span: __binding_0,
                        name: __binding_1,
                        expected_element: __binding_2,
                        vector_type: __binding_3 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_invalid_monomorphization_expected_vector_element_type);
                        diag.code(E0511);
                        ;
                        diag.arg("name", __binding_1);
                        diag.arg("expected_element", __binding_2);
                        diag.arg("vector_type", __binding_3);
                        diag.span(__binding_0);
                        diag
                    }
                    InvalidMonomorphization::NonScalableType {
                        span: __binding_0, name: __binding_1, ty: __binding_2 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_invalid_monomorphization_non_scalable_type);
                        diag.code(E0511);
                        ;
                        diag.arg("name", __binding_1);
                        diag.arg("ty", __binding_2);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
701pub enum InvalidMonomorphization<'tcx> {
702    #[diag(codegen_ssa_invalid_monomorphization_basic_integer_type, code = E0511)]
703    BasicIntegerType {
704        #[primary_span]
705        span: Span,
706        name: Symbol,
707        ty: Ty<'tcx>,
708    },
709
710    #[diag(codegen_ssa_invalid_monomorphization_basic_integer_or_ptr_type, code = E0511)]
711    BasicIntegerOrPtrType {
712        #[primary_span]
713        span: Span,
714        name: Symbol,
715        ty: Ty<'tcx>,
716    },
717
718    #[diag(codegen_ssa_invalid_monomorphization_basic_float_type, code = E0511)]
719    BasicFloatType {
720        #[primary_span]
721        span: Span,
722        name: Symbol,
723        ty: Ty<'tcx>,
724    },
725
726    #[diag(codegen_ssa_invalid_monomorphization_float_to_int_unchecked, code = E0511)]
727    FloatToIntUnchecked {
728        #[primary_span]
729        span: Span,
730        ty: Ty<'tcx>,
731    },
732
733    #[diag(codegen_ssa_invalid_monomorphization_floating_point_vector, code = E0511)]
734    FloatingPointVector {
735        #[primary_span]
736        span: Span,
737        name: Symbol,
738        f_ty: FloatTy,
739        in_ty: Ty<'tcx>,
740    },
741
742    #[diag(codegen_ssa_invalid_monomorphization_floating_point_type, code = E0511)]
743    FloatingPointType {
744        #[primary_span]
745        span: Span,
746        name: Symbol,
747        in_ty: Ty<'tcx>,
748    },
749
750    #[diag(codegen_ssa_invalid_monomorphization_unrecognized_intrinsic, code = E0511)]
751    UnrecognizedIntrinsic {
752        #[primary_span]
753        span: Span,
754        name: Symbol,
755    },
756
757    #[diag(codegen_ssa_invalid_monomorphization_simd_argument, code = E0511)]
758    SimdArgument {
759        #[primary_span]
760        span: Span,
761        name: Symbol,
762        ty: Ty<'tcx>,
763    },
764
765    #[diag(codegen_ssa_invalid_monomorphization_simd_input, code = E0511)]
766    SimdInput {
767        #[primary_span]
768        span: Span,
769        name: Symbol,
770        ty: Ty<'tcx>,
771    },
772
773    #[diag(codegen_ssa_invalid_monomorphization_simd_first, code = E0511)]
774    SimdFirst {
775        #[primary_span]
776        span: Span,
777        name: Symbol,
778        ty: Ty<'tcx>,
779    },
780
781    #[diag(codegen_ssa_invalid_monomorphization_simd_second, code = E0511)]
782    SimdSecond {
783        #[primary_span]
784        span: Span,
785        name: Symbol,
786        ty: Ty<'tcx>,
787    },
788
789    #[diag(codegen_ssa_invalid_monomorphization_simd_third, code = E0511)]
790    SimdThird {
791        #[primary_span]
792        span: Span,
793        name: Symbol,
794        ty: Ty<'tcx>,
795    },
796
797    #[diag(codegen_ssa_invalid_monomorphization_simd_return, code = E0511)]
798    SimdReturn {
799        #[primary_span]
800        span: Span,
801        name: Symbol,
802        ty: Ty<'tcx>,
803    },
804
805    #[diag(codegen_ssa_invalid_monomorphization_invalid_bitmask, code = E0511)]
806    InvalidBitmask {
807        #[primary_span]
808        span: Span,
809        name: Symbol,
810        mask_ty: Ty<'tcx>,
811        expected_int_bits: u64,
812        expected_bytes: u64,
813    },
814
815    #[diag(codegen_ssa_invalid_monomorphization_return_length_input_type, code = E0511)]
816    ReturnLengthInputType {
817        #[primary_span]
818        span: Span,
819        name: Symbol,
820        in_len: u64,
821        in_ty: Ty<'tcx>,
822        ret_ty: Ty<'tcx>,
823        out_len: u64,
824    },
825
826    #[diag(codegen_ssa_invalid_monomorphization_second_argument_length, code = E0511)]
827    SecondArgumentLength {
828        #[primary_span]
829        span: Span,
830        name: Symbol,
831        in_len: u64,
832        in_ty: Ty<'tcx>,
833        arg_ty: Ty<'tcx>,
834        out_len: u64,
835    },
836
837    #[diag(codegen_ssa_invalid_monomorphization_third_argument_length, code = E0511)]
838    ThirdArgumentLength {
839        #[primary_span]
840        span: Span,
841        name: Symbol,
842        in_len: u64,
843        in_ty: Ty<'tcx>,
844        arg_ty: Ty<'tcx>,
845        out_len: u64,
846    },
847
848    #[diag(codegen_ssa_invalid_monomorphization_return_integer_type, code = E0511)]
849    ReturnIntegerType {
850        #[primary_span]
851        span: Span,
852        name: Symbol,
853        ret_ty: Ty<'tcx>,
854        out_ty: Ty<'tcx>,
855    },
856
857    #[diag(codegen_ssa_invalid_monomorphization_simd_shuffle, code = E0511)]
858    SimdShuffle {
859        #[primary_span]
860        span: Span,
861        name: Symbol,
862        ty: Ty<'tcx>,
863    },
864
865    #[diag(codegen_ssa_invalid_monomorphization_return_length, code = E0511)]
866    ReturnLength {
867        #[primary_span]
868        span: Span,
869        name: Symbol,
870        in_len: u64,
871        ret_ty: Ty<'tcx>,
872        out_len: u64,
873    },
874
875    #[diag(codegen_ssa_invalid_monomorphization_return_element, code = E0511)]
876    ReturnElement {
877        #[primary_span]
878        span: Span,
879        name: Symbol,
880        in_elem: Ty<'tcx>,
881        in_ty: Ty<'tcx>,
882        ret_ty: Ty<'tcx>,
883        out_ty: Ty<'tcx>,
884    },
885
886    #[diag(codegen_ssa_invalid_monomorphization_simd_index_out_of_bounds, code = E0511)]
887    SimdIndexOutOfBounds {
888        #[primary_span]
889        span: Span,
890        name: Symbol,
891        arg_idx: u64,
892        total_len: u128,
893    },
894
895    #[diag(codegen_ssa_invalid_monomorphization_inserted_type, code = E0511)]
896    InsertedType {
897        #[primary_span]
898        span: Span,
899        name: Symbol,
900        in_elem: Ty<'tcx>,
901        in_ty: Ty<'tcx>,
902        out_ty: Ty<'tcx>,
903    },
904
905    #[diag(codegen_ssa_invalid_monomorphization_return_type, code = E0511)]
906    ReturnType {
907        #[primary_span]
908        span: Span,
909        name: Symbol,
910        in_elem: Ty<'tcx>,
911        in_ty: Ty<'tcx>,
912        ret_ty: Ty<'tcx>,
913    },
914
915    #[diag(codegen_ssa_invalid_monomorphization_expected_return_type, code = E0511)]
916    ExpectedReturnType {
917        #[primary_span]
918        span: Span,
919        name: Symbol,
920        in_ty: Ty<'tcx>,
921        ret_ty: Ty<'tcx>,
922    },
923
924    #[diag(codegen_ssa_invalid_monomorphization_mismatched_lengths, code = E0511)]
925    MismatchedLengths {
926        #[primary_span]
927        span: Span,
928        name: Symbol,
929        m_len: u64,
930        v_len: u64,
931    },
932
933    #[diag(codegen_ssa_invalid_monomorphization_mask_wrong_element_type, code = E0511)]
934    MaskWrongElementType {
935        #[primary_span]
936        span: Span,
937        name: Symbol,
938        ty: Ty<'tcx>,
939    },
940
941    #[diag(codegen_ssa_invalid_monomorphization_cannot_return, code = E0511)]
942    CannotReturn {
943        #[primary_span]
944        span: Span,
945        name: Symbol,
946        ret_ty: Ty<'tcx>,
947        expected_int_bits: u64,
948        expected_bytes: u64,
949    },
950
951    #[diag(codegen_ssa_invalid_monomorphization_expected_element_type, code = E0511)]
952    ExpectedElementType {
953        #[primary_span]
954        span: Span,
955        name: Symbol,
956        expected_element: Ty<'tcx>,
957        second_arg: Ty<'tcx>,
958        in_elem: Ty<'tcx>,
959        in_ty: Ty<'tcx>,
960        mutability: ExpectedPointerMutability,
961    },
962
963    #[diag(codegen_ssa_invalid_monomorphization_unsupported_symbol_of_size, code = E0511)]
964    UnsupportedSymbolOfSize {
965        #[primary_span]
966        span: Span,
967        name: Symbol,
968        symbol: Symbol,
969        in_ty: Ty<'tcx>,
970        in_elem: Ty<'tcx>,
971        size: u64,
972        ret_ty: Ty<'tcx>,
973    },
974
975    #[diag(codegen_ssa_invalid_monomorphization_unsupported_symbol, code = E0511)]
976    UnsupportedSymbol {
977        #[primary_span]
978        span: Span,
979        name: Symbol,
980        symbol: Symbol,
981        in_ty: Ty<'tcx>,
982        in_elem: Ty<'tcx>,
983        ret_ty: Ty<'tcx>,
984    },
985
986    #[diag(codegen_ssa_invalid_monomorphization_cast_wide_pointer, code = E0511)]
987    CastWidePointer {
988        #[primary_span]
989        span: Span,
990        name: Symbol,
991        ty: Ty<'tcx>,
992    },
993
994    #[diag(codegen_ssa_invalid_monomorphization_expected_pointer, code = E0511)]
995    ExpectedPointer {
996        #[primary_span]
997        span: Span,
998        name: Symbol,
999        ty: Ty<'tcx>,
1000    },
1001
1002    #[diag(codegen_ssa_invalid_monomorphization_expected_usize, code = E0511)]
1003    ExpectedUsize {
1004        #[primary_span]
1005        span: Span,
1006        name: Symbol,
1007        ty: Ty<'tcx>,
1008    },
1009
1010    #[diag(codegen_ssa_invalid_monomorphization_unsupported_cast, code = E0511)]
1011    UnsupportedCast {
1012        #[primary_span]
1013        span: Span,
1014        name: Symbol,
1015        in_ty: Ty<'tcx>,
1016        in_elem: Ty<'tcx>,
1017        ret_ty: Ty<'tcx>,
1018        out_elem: Ty<'tcx>,
1019    },
1020
1021    #[diag(codegen_ssa_invalid_monomorphization_unsupported_operation, code = E0511)]
1022    UnsupportedOperation {
1023        #[primary_span]
1024        span: Span,
1025        name: Symbol,
1026        in_ty: Ty<'tcx>,
1027        in_elem: Ty<'tcx>,
1028    },
1029
1030    #[diag(codegen_ssa_invalid_monomorphization_expected_vector_element_type, code = E0511)]
1031    ExpectedVectorElementType {
1032        #[primary_span]
1033        span: Span,
1034        name: Symbol,
1035        expected_element: Ty<'tcx>,
1036        vector_type: Ty<'tcx>,
1037    },
1038
1039    #[diag(codegen_ssa_invalid_monomorphization_non_scalable_type, code = E0511)]
1040    NonScalableType {
1041        #[primary_span]
1042        span: Span,
1043        name: Symbol,
1044        ty: Ty<'tcx>,
1045    },
1046}
1047
1048pub enum ExpectedPointerMutability {
1049    Mut,
1050    Not,
1051}
1052
1053impl IntoDiagArg for ExpectedPointerMutability {
1054    fn into_diag_arg(self, _: &mut Option<std::path::PathBuf>) -> DiagArgValue {
1055        match self {
1056            ExpectedPointerMutability::Mut => DiagArgValue::Str(Cow::Borrowed("*mut")),
1057            ExpectedPointerMutability::Not => DiagArgValue::Str(Cow::Borrowed("*_")),
1058        }
1059    }
1060}
1061
1062#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            TargetFeatureSafeTrait where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    TargetFeatureSafeTrait { span: __binding_0, def: __binding_1
                        } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_target_feature_safe_trait);
                        ;
                        diag.span(__binding_0);
                        diag.span_label(__binding_0,
                            crate::fluent_generated::_subdiag::label);
                        diag.span_label(__binding_1,
                            crate::fluent_generated::codegen_ssa_label_def);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1063#[diag(codegen_ssa_target_feature_safe_trait)]
1064pub(crate) struct TargetFeatureSafeTrait {
1065    #[primary_span]
1066    #[label]
1067    pub span: Span,
1068    #[label(codegen_ssa_label_def)]
1069    pub def: Span,
1070}
1071
1072#[derive(const _: () =
    {
        impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
            ForbiddenTargetFeatureAttr<'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 {
                    ForbiddenTargetFeatureAttr {
                        span: __binding_0, feature: __binding_1, reason: __binding_2
                        } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_forbidden_target_feature_attr);
                        ;
                        diag.arg("feature", __binding_1);
                        diag.arg("reason", __binding_2);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1073#[diag(codegen_ssa_forbidden_target_feature_attr)]
1074pub struct ForbiddenTargetFeatureAttr<'a> {
1075    #[primary_span]
1076    pub span: Span,
1077    pub feature: &'a str,
1078    pub reason: &'a str,
1079}
1080
1081#[derive(const _: () =
    {
        impl<'_sess, 'tcx, G> rustc_errors::Diagnostic<'_sess, G> for
            FailedToGetLayout<'tcx> where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    FailedToGetLayout {
                        span: __binding_0, ty: __binding_1, err: __binding_2 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_failed_to_get_layout);
                        ;
                        diag.arg("ty", __binding_1);
                        diag.arg("err", __binding_2);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1082#[diag(codegen_ssa_failed_to_get_layout)]
1083pub struct FailedToGetLayout<'tcx> {
1084    #[primary_span]
1085    pub span: Span,
1086    pub ty: Ty<'tcx>,
1087    pub err: LayoutError<'tcx>,
1088}
1089
1090#[derive(const _: () =
    {
        impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
            DlltoolFailImportLibrary<'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 {
                    DlltoolFailImportLibrary {
                        dlltool_path: __binding_0,
                        dlltool_args: __binding_1,
                        stdout: __binding_2,
                        stderr: __binding_3 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_dlltool_fail_import_library);
                        ;
                        diag.arg("dlltool_path", __binding_0);
                        diag.arg("dlltool_args", __binding_1);
                        diag.arg("stdout", __binding_2);
                        diag.arg("stderr", __binding_3);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1091#[diag(codegen_ssa_dlltool_fail_import_library)]
1092pub(crate) struct DlltoolFailImportLibrary<'a> {
1093    pub dlltool_path: Cow<'a, str>,
1094    pub dlltool_args: String,
1095    pub stdout: Cow<'a, str>,
1096    pub stderr: Cow<'a, str>,
1097}
1098
1099#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            ErrorWritingDEFFile where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    ErrorWritingDEFFile { error: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_error_writing_def_file);
                        ;
                        diag.arg("error", __binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1100#[diag(codegen_ssa_error_writing_def_file)]
1101pub(crate) struct ErrorWritingDEFFile {
1102    pub error: std::io::Error,
1103}
1104
1105#[derive(const _: () =
    {
        impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
            ErrorCallingDllTool<'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 {
                    ErrorCallingDllTool {
                        dlltool_path: __binding_0, error: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_error_calling_dlltool);
                        ;
                        diag.arg("dlltool_path", __binding_0);
                        diag.arg("error", __binding_1);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1106#[diag(codegen_ssa_error_calling_dlltool)]
1107pub(crate) struct ErrorCallingDllTool<'a> {
1108    pub dlltool_path: Cow<'a, str>,
1109    pub error: std::io::Error,
1110}
1111
1112#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            ErrorCreatingRemarkDir where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    ErrorCreatingRemarkDir { error: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_error_creating_remark_dir);
                        ;
                        diag.arg("error", __binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1113#[diag(codegen_ssa_error_creating_remark_dir)]
1114pub(crate) struct ErrorCreatingRemarkDir {
1115    pub error: std::io::Error,
1116}
1117
1118#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            CompilerBuiltinsCannotCall where
            G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    CompilerBuiltinsCannotCall {
                        caller: __binding_0, callee: __binding_1, span: __binding_2
                        } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_compiler_builtins_cannot_call);
                        ;
                        diag.arg("caller", __binding_0);
                        diag.arg("callee", __binding_1);
                        diag.span(__binding_2);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1119#[diag(codegen_ssa_compiler_builtins_cannot_call)]
1120pub struct CompilerBuiltinsCannotCall {
1121    pub caller: String,
1122    pub callee: String,
1123    #[primary_span]
1124    pub span: Span,
1125}
1126
1127#[derive(const _: () =
    {
        impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
            ErrorCreatingImportLibrary<'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 {
                    ErrorCreatingImportLibrary {
                        lib_name: __binding_0, error: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_error_creating_import_library);
                        ;
                        diag.arg("lib_name", __binding_0);
                        diag.arg("error", __binding_1);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1128#[diag(codegen_ssa_error_creating_import_library)]
1129pub(crate) struct ErrorCreatingImportLibrary<'a> {
1130    pub lib_name: &'a str,
1131    pub error: String,
1132}
1133
1134#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            AixStripNotUsed where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    AixStripNotUsed => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_aix_strip_not_used);
                        ;
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1135#[diag(codegen_ssa_aix_strip_not_used)]
1136pub(crate) struct AixStripNotUsed;
1137
1138#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for XcrunError
            where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    XcrunError::FailedInvoking {
                        sdk_name: __binding_0,
                        command_formatted: __binding_1,
                        error: __binding_2 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_xcrun_failed_invoking);
                        ;
                        diag.arg("sdk_name", __binding_0);
                        diag.arg("command_formatted", __binding_1);
                        diag.arg("error", __binding_2);
                        diag
                    }
                    XcrunError::Unsuccessful {
                        sdk_name: __binding_0,
                        command_formatted: __binding_1,
                        stdout: __binding_2,
                        stderr: __binding_3 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_xcrun_unsuccessful);
                        diag.note(crate::fluent_generated::_subdiag::note);
                        ;
                        diag.arg("sdk_name", __binding_0);
                        diag.arg("command_formatted", __binding_1);
                        diag.arg("stdout", __binding_2);
                        diag.arg("stderr", __binding_3);
                        diag
                    }
                }
            }
        }
    };Diagnostic, #[automatically_derived]
impl ::core::fmt::Debug for XcrunError {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            XcrunError::FailedInvoking {
                sdk_name: __self_0,
                command_formatted: __self_1,
                error: __self_2 } =>
                ::core::fmt::Formatter::debug_struct_field3_finish(f,
                    "FailedInvoking", "sdk_name", __self_0, "command_formatted",
                    __self_1, "error", &__self_2),
            XcrunError::Unsuccessful {
                sdk_name: __self_0,
                command_formatted: __self_1,
                stdout: __self_2,
                stderr: __self_3 } =>
                ::core::fmt::Formatter::debug_struct_field4_finish(f,
                    "Unsuccessful", "sdk_name", __self_0, "command_formatted",
                    __self_1, "stdout", __self_2, "stderr", &__self_3),
        }
    }
}Debug)]
1139pub(crate) enum XcrunError {
1140    #[diag(codegen_ssa_xcrun_failed_invoking)]
1141    FailedInvoking { sdk_name: &'static str, command_formatted: String, error: std::io::Error },
1142
1143    #[diag(codegen_ssa_xcrun_unsuccessful)]
1144    #[note]
1145    Unsuccessful {
1146        sdk_name: &'static str,
1147        command_formatted: String,
1148        stdout: String,
1149        stderr: String,
1150    },
1151}
1152
1153#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            XcrunSdkPathWarning where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    XcrunSdkPathWarning {
                        sdk_name: __binding_0, stderr: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_xcrun_sdk_path_warning);
                        diag.note(crate::fluent_generated::_subdiag::note);
                        ;
                        diag.arg("sdk_name", __binding_0);
                        diag.arg("stderr", __binding_1);
                        diag
                    }
                }
            }
        }
    };Diagnostic, #[automatically_derived]
impl ::core::fmt::Debug for XcrunSdkPathWarning {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field2_finish(f,
            "XcrunSdkPathWarning", "sdk_name", &self.sdk_name, "stderr",
            &&self.stderr)
    }
}Debug)]
1154#[diag(codegen_ssa_xcrun_sdk_path_warning)]
1155#[note]
1156pub(crate) struct XcrunSdkPathWarning {
1157    pub sdk_name: &'static str,
1158    pub stderr: String,
1159}
1160
1161#[derive(const _: () =
    {
        impl<'__a> rustc_errors::LintDiagnostic<'__a, ()> for
            Aarch64SoftfloatNeon {
            #[track_caller]
            fn decorate_lint<'__b>(self,
                diag: &'__b mut rustc_errors::Diag<'__a, ()>) {
                match self {
                    Aarch64SoftfloatNeon => {
                        diag.primary_message(crate::fluent_generated::codegen_ssa_aarch64_softfloat_neon);
                        ;
                        diag
                    }
                };
            }
        }
    };LintDiagnostic)]
1162#[diag(codegen_ssa_aarch64_softfloat_neon)]
1163pub(crate) struct Aarch64SoftfloatNeon;
1164
1165#[derive(const _: () =
    {
        impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
            UnknownCTargetFeaturePrefix<'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 {
                    UnknownCTargetFeaturePrefix { feature: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_unknown_ctarget_feature_prefix);
                        diag.note(crate::fluent_generated::_subdiag::note);
                        ;
                        diag.arg("feature", __binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1166#[diag(codegen_ssa_unknown_ctarget_feature_prefix)]
1167#[note]
1168pub(crate) struct UnknownCTargetFeaturePrefix<'a> {
1169    pub feature: &'a str,
1170}
1171
1172#[derive(const _: () =
    {
        impl<'a> rustc_errors::Subdiagnostic for PossibleFeature<'a> {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    PossibleFeature::Some { rust_feature: __binding_0 } => {
                        diag.store_args();
                        diag.arg("rust_feature", __binding_0);
                        let __message =
                            diag.eagerly_translate(crate::fluent_generated::codegen_ssa_possible_feature);
                        diag.help(__message);
                        diag.restore_args();
                    }
                    PossibleFeature::None => {
                        diag.store_args();
                        let __message =
                            diag.eagerly_translate(crate::fluent_generated::codegen_ssa_consider_filing_feature_request);
                        diag.help(__message);
                        diag.restore_args();
                    }
                }
            }
        }
    };Subdiagnostic)]
1173pub(crate) enum PossibleFeature<'a> {
1174    #[help(codegen_ssa_possible_feature)]
1175    Some { rust_feature: &'a str },
1176    #[help(codegen_ssa_consider_filing_feature_request)]
1177    None,
1178}
1179
1180#[derive(const _: () =
    {
        impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
            UnknownCTargetFeature<'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 {
                    UnknownCTargetFeature {
                        feature: __binding_0, rust_feature: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_unknown_ctarget_feature);
                        diag.note(crate::fluent_generated::_subdiag::note);
                        ;
                        diag.arg("feature", __binding_0);
                        diag.subdiagnostic(__binding_1);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1181#[diag(codegen_ssa_unknown_ctarget_feature)]
1182#[note]
1183pub(crate) struct UnknownCTargetFeature<'a> {
1184    pub feature: &'a str,
1185    #[subdiagnostic]
1186    pub rust_feature: PossibleFeature<'a>,
1187}
1188
1189#[derive(const _: () =
    {
        impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
            UnstableCTargetFeature<'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 {
                    UnstableCTargetFeature { feature: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_unstable_ctarget_feature);
                        diag.note(crate::fluent_generated::_subdiag::note);
                        ;
                        diag.arg("feature", __binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1190#[diag(codegen_ssa_unstable_ctarget_feature)]
1191#[note]
1192pub(crate) struct UnstableCTargetFeature<'a> {
1193    pub feature: &'a str,
1194}
1195
1196#[derive(const _: () =
    {
        impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
            ForbiddenCTargetFeature<'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 {
                    ForbiddenCTargetFeature {
                        feature: __binding_0,
                        enabled: __binding_1,
                        reason: __binding_2 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_forbidden_ctarget_feature);
                        diag.note(crate::fluent_generated::_subdiag::note);
                        diag.note(crate::fluent_generated::codegen_ssa_forbidden_ctarget_feature_issue);
                        ;
                        diag.arg("feature", __binding_0);
                        diag.arg("enabled", __binding_1);
                        diag.arg("reason", __binding_2);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1197#[diag(codegen_ssa_forbidden_ctarget_feature)]
1198#[note]
1199#[note(codegen_ssa_forbidden_ctarget_feature_issue)]
1200pub(crate) struct ForbiddenCTargetFeature<'a> {
1201    pub feature: &'a str,
1202    pub enabled: &'a str,
1203    pub reason: &'a str,
1204}
1205
1206pub struct TargetFeatureDisableOrEnable<'a> {
1207    pub features: &'a [&'a str],
1208    pub span: Option<Span>,
1209    pub missing_features: Option<MissingFeatures>,
1210}
1211
1212#[derive(const _: () =
    {
        impl rustc_errors::Subdiagnostic for MissingFeatures {
            fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
                where __G: rustc_errors::EmissionGuarantee {
                match self {
                    MissingFeatures => {
                        diag.store_args();
                        let __message =
                            diag.eagerly_translate(crate::fluent_generated::codegen_ssa_missing_features);
                        diag.help(__message);
                        diag.restore_args();
                    }
                }
            }
        }
    };Subdiagnostic)]
1213#[help(codegen_ssa_missing_features)]
1214pub struct MissingFeatures;
1215
1216impl<G: EmissionGuarantee> Diagnostic<'_, G> for TargetFeatureDisableOrEnable<'_> {
1217    fn into_diag(self, dcx: DiagCtxtHandle<'_>, level: Level) -> Diag<'_, G> {
1218        let mut diag = Diag::new(dcx, level, fluent::codegen_ssa_target_feature_disable_or_enable);
1219        if let Some(span) = self.span {
1220            diag.span(span);
1221        };
1222        if let Some(missing_features) = self.missing_features {
1223            diag.subdiagnostic(missing_features);
1224        }
1225        diag.arg("features", self.features.join(", "));
1226        diag
1227    }
1228}
1229
1230#[derive(const _: () =
    {
        impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
            FeatureNotValid<'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 {
                    FeatureNotValid {
                        feature: __binding_0,
                        span: __binding_1,
                        plus_hint: __binding_2 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_feature_not_valid);
                        ;
                        diag.arg("feature", __binding_0);
                        diag.span(__binding_1);
                        diag.span_label(__binding_1,
                            crate::fluent_generated::_subdiag::label);
                        if __binding_2 {
                            diag.help(crate::fluent_generated::_subdiag::help);
                        }
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1231#[diag(codegen_ssa_feature_not_valid)]
1232pub(crate) struct FeatureNotValid<'a> {
1233    pub feature: &'a str,
1234    #[primary_span]
1235    #[label]
1236    pub span: Span,
1237    #[help]
1238    pub plus_hint: bool,
1239}
1240
1241#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for LtoDisallowed
            where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    LtoDisallowed => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_lto_disallowed);
                        ;
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1242#[diag(codegen_ssa_lto_disallowed)]
1243pub(crate) struct LtoDisallowed;
1244
1245#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for LtoDylib where
            G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    LtoDylib => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_lto_dylib);
                        ;
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1246#[diag(codegen_ssa_lto_dylib)]
1247pub(crate) struct LtoDylib;
1248
1249#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for LtoProcMacro
            where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    LtoProcMacro => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_lto_proc_macro);
                        ;
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1250#[diag(codegen_ssa_lto_proc_macro)]
1251pub(crate) struct LtoProcMacro;
1252
1253#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            DynamicLinkingWithLTO where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    DynamicLinkingWithLTO => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_ssa_dynamic_linking_with_lto);
                        diag.note(crate::fluent_generated::_subdiag::note);
                        ;
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
1254#[diag(codegen_ssa_dynamic_linking_with_lto)]
1255#[note]
1256pub(crate) struct DynamicLinkingWithLTO;