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