Skip to main content

rustc_codegen_llvm/
errors.rs

1use std::ffi::CString;
2use std::path::Path;
3
4use rustc_data_structures::small_c_str::SmallCStr;
5use rustc_errors::{Diag, DiagCtxtHandle, Diagnostic, EmissionGuarantee, Level};
6use rustc_macros::Diagnostic;
7use rustc_span::Span;
8
9use crate::fluent_generated as fluent;
10
11#[derive(const _: () =
    {
        impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
            SymbolAlreadyDefined<'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 {
                    SymbolAlreadyDefined {
                        span: __binding_0, symbol_name: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_llvm_symbol_already_defined);
                        ;
                        diag.arg("symbol_name", __binding_1);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
12#[diag(codegen_llvm_symbol_already_defined)]
13pub(crate) struct SymbolAlreadyDefined<'a> {
14    #[primary_span]
15    pub span: Span,
16    pub symbol_name: &'a str,
17}
18
19#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            SanitizerMemtagRequiresMte where
            G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    SanitizerMemtagRequiresMte => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_llvm_sanitizer_memtag_requires_mte);
                        ;
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
20#[diag(codegen_llvm_sanitizer_memtag_requires_mte)]
21pub(crate) struct SanitizerMemtagRequiresMte;
22
23pub(crate) struct ParseTargetMachineConfig<'a>(pub LlvmError<'a>);
24
25impl<G: EmissionGuarantee> Diagnostic<'_, G> for ParseTargetMachineConfig<'_> {
26    fn into_diag(self, dcx: DiagCtxtHandle<'_>, level: Level) -> Diag<'_, G> {
27        let diag: Diag<'_, G> = self.0.into_diag(dcx, level);
28        let (message, _) = diag.messages.first().expect("`LlvmError` with no message");
29        let message = dcx.eagerly_translate_to_string(message.clone(), diag.args.iter());
30        Diag::new(dcx, level, fluent::codegen_llvm_parse_target_machine_config)
31            .with_arg("error", message)
32    }
33}
34
35#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            AutoDiffComponentUnavailable where
            G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    AutoDiffComponentUnavailable { err: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_llvm_autodiff_component_unavailable);
                        ;
                        diag.arg("err", __binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
36#[diag(codegen_llvm_autodiff_component_unavailable)]
37pub(crate) struct AutoDiffComponentUnavailable {
38    pub err: String,
39}
40
41#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            AutoDiffComponentMissing where G: rustc_errors::EmissionGuarantee
            {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    AutoDiffComponentMissing { err: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_llvm_autodiff_component_missing);
                        diag.note(crate::fluent_generated::_subdiag::note);
                        ;
                        diag.arg("err", __binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
42#[diag(codegen_llvm_autodiff_component_missing)]
43#[note]
44pub(crate) struct AutoDiffComponentMissing {
45    pub err: String,
46}
47
48#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            AutoDiffWithoutLto where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    AutoDiffWithoutLto => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_llvm_autodiff_without_lto);
                        ;
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
49#[diag(codegen_llvm_autodiff_without_lto)]
50pub(crate) struct AutoDiffWithoutLto;
51
52#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            AutoDiffWithoutEnable where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    AutoDiffWithoutEnable => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_llvm_autodiff_without_enable);
                        ;
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
53#[diag(codegen_llvm_autodiff_without_enable)]
54pub(crate) struct AutoDiffWithoutEnable;
55
56#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            OffloadWithoutEnable where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    OffloadWithoutEnable => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_llvm_offload_without_enable);
                        ;
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
57#[diag(codegen_llvm_offload_without_enable)]
58pub(crate) struct OffloadWithoutEnable;
59
60#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            OffloadWithoutFatLTO where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    OffloadWithoutFatLTO => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_llvm_offload_without_fat_lto);
                        ;
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
61#[diag(codegen_llvm_offload_without_fat_lto)]
62pub(crate) struct OffloadWithoutFatLTO;
63
64#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            OffloadWithoutAbsPath where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    OffloadWithoutAbsPath => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_llvm_offload_no_abs_path);
                        ;
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
65#[diag(codegen_llvm_offload_no_abs_path)]
66pub(crate) struct OffloadWithoutAbsPath;
67
68#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            OffloadWrongFileName where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    OffloadWrongFileName => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_llvm_offload_no_host_out);
                        ;
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
69#[diag(codegen_llvm_offload_no_host_out)]
70pub(crate) struct OffloadWrongFileName;
71
72#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            OffloadNonexistingPath where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    OffloadNonexistingPath => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_llvm_offload_nonexisting);
                        ;
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
73#[diag(codegen_llvm_offload_nonexisting)]
74pub(crate) struct OffloadNonexistingPath;
75
76#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            OffloadBundleImagesFailed where G: rustc_errors::EmissionGuarantee
            {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    OffloadBundleImagesFailed => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_llvm_offload_bundleimages_failed);
                        ;
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
77#[diag(codegen_llvm_offload_bundleimages_failed)]
78pub(crate) struct OffloadBundleImagesFailed;
79
80#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            OffloadEmbedFailed where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    OffloadEmbedFailed => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_llvm_offload_embed_failed);
                        ;
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
81#[diag(codegen_llvm_offload_embed_failed)]
82pub(crate) struct OffloadEmbedFailed;
83
84#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            LtoBitcodeFromRlib where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    LtoBitcodeFromRlib { err: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_llvm_lto_bitcode_from_rlib);
                        ;
                        diag.arg("err", __binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
85#[diag(codegen_llvm_lto_bitcode_from_rlib)]
86pub(crate) struct LtoBitcodeFromRlib {
87    pub err: String,
88}
89
90#[derive(const _: () =
    {
        impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
            LlvmError<'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 {
                    LlvmError::WriteOutput { path: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_llvm_write_output);
                        ;
                        diag.arg("path", __binding_0);
                        diag
                    }
                    LlvmError::CreateTargetMachine { triple: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_llvm_target_machine);
                        ;
                        diag.arg("triple", __binding_0);
                        diag
                    }
                    LlvmError::RunLlvmPasses => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_llvm_run_passes);
                        ;
                        diag
                    }
                    LlvmError::SerializeModule { name: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_llvm_serialize_module);
                        ;
                        diag.arg("name", __binding_0);
                        diag
                    }
                    LlvmError::WriteIr { path: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_llvm_write_ir);
                        ;
                        diag.arg("path", __binding_0);
                        diag
                    }
                    LlvmError::PrepareThinLtoContext => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_llvm_prepare_thin_lto_context);
                        ;
                        diag
                    }
                    LlvmError::LoadBitcode { name: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_llvm_load_bitcode);
                        ;
                        diag.arg("name", __binding_0);
                        diag
                    }
                    LlvmError::WriteThinLtoKey { err: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_llvm_write_thinlto_key);
                        ;
                        diag.arg("err", __binding_0);
                        diag
                    }
                    LlvmError::PrepareThinLtoModule => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_llvm_prepare_thin_lto_module);
                        ;
                        diag
                    }
                    LlvmError::ParseBitcode => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_llvm_parse_bitcode);
                        ;
                        diag
                    }
                    LlvmError::PrepareAutoDiff {
                        src: __binding_0, target: __binding_1, error: __binding_2 }
                        => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_llvm_prepare_autodiff);
                        ;
                        diag.arg("src", __binding_0);
                        diag.arg("target", __binding_1);
                        diag.arg("error", __binding_2);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
91pub enum LlvmError<'a> {
92    #[diag(codegen_llvm_write_output)]
93    WriteOutput { path: &'a Path },
94    #[diag(codegen_llvm_target_machine)]
95    CreateTargetMachine { triple: SmallCStr },
96    #[diag(codegen_llvm_run_passes)]
97    RunLlvmPasses,
98    #[diag(codegen_llvm_serialize_module)]
99    SerializeModule { name: &'a str },
100    #[diag(codegen_llvm_write_ir)]
101    WriteIr { path: &'a Path },
102    #[diag(codegen_llvm_prepare_thin_lto_context)]
103    PrepareThinLtoContext,
104    #[diag(codegen_llvm_load_bitcode)]
105    LoadBitcode { name: CString },
106    #[diag(codegen_llvm_write_thinlto_key)]
107    WriteThinLtoKey { err: std::io::Error },
108    #[diag(codegen_llvm_prepare_thin_lto_module)]
109    PrepareThinLtoModule,
110    #[diag(codegen_llvm_parse_bitcode)]
111    ParseBitcode,
112    #[diag(codegen_llvm_prepare_autodiff)]
113    PrepareAutoDiff { src: String, target: String, error: String },
114}
115
116pub(crate) struct WithLlvmError<'a>(pub LlvmError<'a>, pub String);
117
118impl<G: EmissionGuarantee> Diagnostic<'_, G> for WithLlvmError<'_> {
119    fn into_diag(self, dcx: DiagCtxtHandle<'_>, level: Level) -> Diag<'_, G> {
120        use LlvmError::*;
121        let msg_with_llvm_err = match &self.0 {
122            WriteOutput { .. } => fluent::codegen_llvm_write_output_with_llvm_err,
123            CreateTargetMachine { .. } => fluent::codegen_llvm_target_machine_with_llvm_err,
124            RunLlvmPasses => fluent::codegen_llvm_run_passes_with_llvm_err,
125            SerializeModule { .. } => fluent::codegen_llvm_serialize_module_with_llvm_err,
126            WriteIr { .. } => fluent::codegen_llvm_write_ir_with_llvm_err,
127            PrepareThinLtoContext => fluent::codegen_llvm_prepare_thin_lto_context_with_llvm_err,
128            LoadBitcode { .. } => fluent::codegen_llvm_load_bitcode_with_llvm_err,
129            WriteThinLtoKey { .. } => fluent::codegen_llvm_write_thinlto_key_with_llvm_err,
130            PrepareThinLtoModule => fluent::codegen_llvm_prepare_thin_lto_module_with_llvm_err,
131            ParseBitcode => fluent::codegen_llvm_parse_bitcode_with_llvm_err,
132            PrepareAutoDiff { .. } => fluent::codegen_llvm_prepare_autodiff_with_llvm_err,
133        };
134        self.0
135            .into_diag(dcx, level)
136            .with_primary_message(msg_with_llvm_err)
137            .with_arg("llvm_err", self.1)
138    }
139}
140
141#[derive(const _: () =
    {
        impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
            FromLlvmOptimizationDiag<'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 {
                    FromLlvmOptimizationDiag {
                        filename: __binding_0,
                        line: __binding_1,
                        column: __binding_2,
                        pass_name: __binding_3,
                        kind: __binding_4,
                        message: __binding_5 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_llvm_from_llvm_optimization_diag);
                        ;
                        diag.arg("filename", __binding_0);
                        diag.arg("line", __binding_1);
                        diag.arg("column", __binding_2);
                        diag.arg("pass_name", __binding_3);
                        diag.arg("kind", __binding_4);
                        diag.arg("message", __binding_5);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
142#[diag(codegen_llvm_from_llvm_optimization_diag)]
143pub(crate) struct FromLlvmOptimizationDiag<'a> {
144    pub filename: &'a str,
145    pub line: std::ffi::c_uint,
146    pub column: std::ffi::c_uint,
147    pub pass_name: &'a str,
148    pub kind: &'a str,
149    pub message: &'a str,
150}
151
152#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for FromLlvmDiag
            where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    FromLlvmDiag { message: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_llvm_from_llvm_diag);
                        ;
                        diag.arg("message", __binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
153#[diag(codegen_llvm_from_llvm_diag)]
154pub(crate) struct FromLlvmDiag {
155    pub message: String,
156}
157
158#[derive(const _: () =
    {
        impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
            WriteBytecode<'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 {
                    WriteBytecode { path: __binding_0, err: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_llvm_write_bytecode);
                        ;
                        diag.arg("path", __binding_0);
                        diag.arg("err", __binding_1);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
159#[diag(codegen_llvm_write_bytecode)]
160pub(crate) struct WriteBytecode<'a> {
161    pub path: &'a Path,
162    pub err: std::io::Error,
163}
164
165#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for CopyBitcode
            where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    CopyBitcode { err: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_llvm_copy_bitcode);
                        ;
                        diag.arg("err", __binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
166#[diag(codegen_llvm_copy_bitcode)]
167pub(crate) struct CopyBitcode {
168    pub err: std::io::Error,
169}
170
171#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            UnknownCompression where G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    UnknownCompression { algorithm: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_llvm_unknown_debuginfo_compression);
                        ;
                        diag.arg("algorithm", __binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
172#[diag(codegen_llvm_unknown_debuginfo_compression)]
173pub(crate) struct UnknownCompression {
174    pub algorithm: &'static str,
175}
176
177#[derive(const _: () =
    {
        impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
            MismatchedDataLayout<'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 {
                    MismatchedDataLayout {
                        rustc_target: __binding_0,
                        rustc_layout: __binding_1,
                        llvm_target: __binding_2,
                        llvm_layout: __binding_3 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_llvm_mismatch_data_layout);
                        ;
                        diag.arg("rustc_target", __binding_0);
                        diag.arg("rustc_layout", __binding_1);
                        diag.arg("llvm_target", __binding_2);
                        diag.arg("llvm_layout", __binding_3);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
178#[diag(codegen_llvm_mismatch_data_layout)]
179pub(crate) struct MismatchedDataLayout<'a> {
180    pub rustc_target: &'a str,
181    pub rustc_layout: &'a str,
182    pub llvm_target: &'a str,
183    pub llvm_layout: &'a str,
184}
185
186#[derive(const _: () =
    {
        impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
            FixedX18InvalidArch<'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 {
                    FixedX18InvalidArch { arch: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_llvm_fixed_x18_invalid_arch);
                        ;
                        diag.arg("arch", __binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
187#[diag(codegen_llvm_fixed_x18_invalid_arch)]
188pub(crate) struct FixedX18InvalidArch<'a> {
189    pub arch: &'a str,
190}
191
192#[derive(const _: () =
    {
        impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
            SanitizerKcfiArityRequiresLLVM2100 where
            G: rustc_errors::EmissionGuarantee {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
                match self {
                    SanitizerKcfiArityRequiresLLVM2100 => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                crate::fluent_generated::codegen_llvm_sanitizer_kcfi_arity_requires_llvm_21_0_0);
                        ;
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
193#[diag(codegen_llvm_sanitizer_kcfi_arity_requires_llvm_21_0_0)]
194pub(crate) struct SanitizerKcfiArityRequiresLLVM2100;