1use std::error::Error;
2
3use rustc_macros::{Diagnostic, Subdiagnostic};
4
5#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for CantEmitMIR
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
CantEmitMIR { error: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::driver_impl_cant_emit_mir);
;
diag.arg("error", __binding_0);
diag
}
}
}
}
};Diagnostic)]
6#[diag(driver_impl_cant_emit_mir)]
7pub struct CantEmitMIR {
8 pub error: std::io::Error,
9}
10
11#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
RlinkUnableToRead where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
RlinkUnableToRead { err: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::driver_impl_rlink_unable_to_read);
;
diag.arg("err", __binding_0);
diag
}
}
}
}
};Diagnostic)]
12#[diag(driver_impl_rlink_unable_to_read)]
13pub(crate) struct RlinkUnableToRead {
14 pub err: std::io::Error,
15}
16
17#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
RLinkWrongFileType where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
RLinkWrongFileType => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::driver_impl_rlink_wrong_file_type);
;
diag
}
}
}
}
};Diagnostic)]
18#[diag(driver_impl_rlink_wrong_file_type)]
19pub(crate) struct RLinkWrongFileType;
20
21#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
RLinkEmptyVersionNumber where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
RLinkEmptyVersionNumber => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::driver_impl_rlink_empty_version_number);
;
diag
}
}
}
}
};Diagnostic)]
22#[diag(driver_impl_rlink_empty_version_number)]
23pub(crate) struct RLinkEmptyVersionNumber;
24
25#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
RLinkEncodingVersionMismatch where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
RLinkEncodingVersionMismatch {
version_array: __binding_0, rlink_version: __binding_1 } =>
{
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::driver_impl_rlink_encoding_version_mismatch);
;
diag.arg("version_array", __binding_0);
diag.arg("rlink_version", __binding_1);
diag
}
}
}
}
};Diagnostic)]
26#[diag(driver_impl_rlink_encoding_version_mismatch)]
27pub(crate) struct RLinkEncodingVersionMismatch {
28 pub version_array: String,
29 pub rlink_version: u32,
30}
31
32#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
RLinkRustcVersionMismatch<'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 {
RLinkRustcVersionMismatch {
rustc_version: __binding_0, current_version: __binding_1 }
=> {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::driver_impl_rlink_rustc_version_mismatch);
;
diag.arg("rustc_version", __binding_0);
diag.arg("current_version", __binding_1);
diag
}
}
}
}
};Diagnostic)]
33#[diag(driver_impl_rlink_rustc_version_mismatch)]
34pub(crate) struct RLinkRustcVersionMismatch<'a> {
35 pub rustc_version: String,
36 pub current_version: &'a str,
37}
38
39#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for RlinkNotAFile
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
RlinkNotAFile => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::driver_impl_rlink_no_a_file);
;
diag
}
}
}
}
};Diagnostic)]
40#[diag(driver_impl_rlink_no_a_file)]
41pub(crate) struct RlinkNotAFile;
42
43#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
RlinkCorruptFile<'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 {
RlinkCorruptFile { file: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::driver_impl_rlink_corrupt_file);
;
diag.arg("file", __binding_0);
diag
}
}
}
}
};Diagnostic)]
44#[diag(driver_impl_rlink_corrupt_file)]
45pub(crate) struct RlinkCorruptFile<'a> {
46 pub file: &'a std::path::Path,
47}
48
49#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for Ice where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
Ice => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::driver_impl_ice);
;
diag
}
}
}
}
};Diagnostic)]
50#[diag(driver_impl_ice)]
51pub(crate) struct Ice;
52
53#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
IceBugReport<'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 {
IceBugReport { bug_report_url: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::driver_impl_ice_bug_report);
;
diag.arg("bug_report_url", __binding_0);
diag
}
}
}
}
};Diagnostic)]
54#[diag(driver_impl_ice_bug_report)]
55pub(crate) struct IceBugReport<'a> {
56 pub bug_report_url: &'a str,
57}
58
59#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
UpdateNightlyNote where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
UpdateNightlyNote => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::driver_impl_ice_bug_report_update_note);
;
diag
}
}
}
}
};Diagnostic)]
60#[diag(driver_impl_ice_bug_report_update_note)]
61pub(crate) struct UpdateNightlyNote;
62
63#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
IceBugReportInternalFeature where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
IceBugReportInternalFeature => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::driver_impl_ice_bug_report_internal_feature);
;
diag
}
}
}
}
};Diagnostic)]
64#[diag(driver_impl_ice_bug_report_internal_feature)]
65pub(crate) struct IceBugReportInternalFeature;
66
67#[derive(const _: () =
{
impl<'_sess, 'a, G> rustc_errors::Diagnostic<'_sess, G> for
IceVersion<'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 {
IceVersion { version: __binding_0, triple: __binding_1 } =>
{
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::driver_impl_ice_version);
;
diag.arg("version", __binding_0);
diag.arg("triple", __binding_1);
diag
}
}
}
}
};Diagnostic)]
68#[diag(driver_impl_ice_version)]
69pub(crate) struct IceVersion<'a> {
70 pub version: &'a str,
71 pub triple: &'a str,
72}
73
74#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for IcePath where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
IcePath { path: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::driver_impl_ice_path);
;
diag.arg("path", __binding_0);
diag
}
}
}
}
};Diagnostic)]
75#[diag(driver_impl_ice_path)]
76pub(crate) struct IcePath {
77 pub path: std::path::PathBuf,
78}
79
80#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for IcePathError
where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
IcePathError {
path: __binding_0, error: __binding_1, env_var: __binding_2
} => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::driver_impl_ice_path_error);
;
diag.arg("path", __binding_0);
diag.arg("error", __binding_1);
if let Some(__binding_2) = __binding_2 {
diag.subdiagnostic(__binding_2);
}
diag
}
}
}
}
};Diagnostic)]
81#[diag(driver_impl_ice_path_error)]
82pub(crate) struct IcePathError {
83 pub path: std::path::PathBuf,
84 pub error: String,
85 #[subdiagnostic]
86 pub env_var: Option<IcePathErrorEnv>,
87}
88
89#[derive(const _: () =
{
impl rustc_errors::Subdiagnostic for IcePathErrorEnv {
fn add_to_diag<__G>(self, diag: &mut rustc_errors::Diag<'_, __G>)
where __G: rustc_errors::EmissionGuarantee {
match self {
IcePathErrorEnv { env_var: __binding_0 } => {
diag.store_args();
diag.arg("env_var", __binding_0);
let __message =
diag.eagerly_translate(crate::fluent_generated::driver_impl_ice_path_error_env);
diag.note(__message);
diag.restore_args();
}
}
}
}
};Subdiagnostic)]
90#[note(driver_impl_ice_path_error_env)]
91pub(crate) struct IcePathErrorEnv {
92 pub env_var: std::path::PathBuf,
93}
94
95#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for IceFlags where
G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
IceFlags { flags: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::driver_impl_ice_flags);
;
diag.arg("flags", __binding_0);
diag
}
}
}
}
};Diagnostic)]
96#[diag(driver_impl_ice_flags)]
97pub(crate) struct IceFlags {
98 pub flags: String,
99}
100
101#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
IceExcludeCargoDefaults where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
IceExcludeCargoDefaults => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::driver_impl_ice_exclude_cargo_defaults);
;
diag
}
}
}
}
};Diagnostic)]
102#[diag(driver_impl_ice_exclude_cargo_defaults)]
103pub(crate) struct IceExcludeCargoDefaults;
104
105#[derive(const _: () =
{
impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for
UnstableFeatureUsage where G: rustc_errors::EmissionGuarantee {
#[track_caller]
fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
level: rustc_errors::Level) -> rustc_errors::Diag<'_sess, G> {
match self {
UnstableFeatureUsage { error: __binding_0 } => {
let mut diag =
rustc_errors::Diag::new(dcx, level,
crate::fluent_generated::driver_impl_unstable_feature_usage);
;
diag.arg("error", __binding_0);
diag
}
}
}
}
};Diagnostic)]
106#[diag(driver_impl_unstable_feature_usage)]
107pub(crate) struct UnstableFeatureUsage {
108 pub error: Box<dyn Error>,
109}