rustc_driver_impl/
session_diagnostics.rs

1use std::error::Error;
2
3use rustc_macros::{Diagnostic, Subdiagnostic};
4
5#[derive(Diagnostic)]
6#[diag(driver_impl_cant_emit_mir)]
7pub struct CantEmitMIR {
8    pub error: std::io::Error,
9}
10
11#[derive(Diagnostic)]
12#[diag(driver_impl_rlink_unable_to_read)]
13pub(crate) struct RlinkUnableToRead {
14    pub err: std::io::Error,
15}
16
17#[derive(Diagnostic)]
18#[diag(driver_impl_rlink_wrong_file_type)]
19pub(crate) struct RLinkWrongFileType;
20
21#[derive(Diagnostic)]
22#[diag(driver_impl_rlink_empty_version_number)]
23pub(crate) struct RLinkEmptyVersionNumber;
24
25#[derive(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(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(Diagnostic)]
40#[diag(driver_impl_rlink_no_a_file)]
41pub(crate) struct RlinkNotAFile;
42
43#[derive(Diagnostic)]
44#[diag(driver_impl_rlink_corrupt_file)]
45pub(crate) struct RlinkCorruptFile<'a> {
46    pub file: &'a std::path::Path,
47}
48
49#[derive(Diagnostic)]
50#[diag(driver_impl_ice)]
51pub(crate) struct Ice;
52
53#[derive(Diagnostic)]
54#[diag(driver_impl_ice_bug_report)]
55pub(crate) struct IceBugReport<'a> {
56    pub bug_report_url: &'a str,
57}
58
59#[derive(Diagnostic)]
60#[diag(driver_impl_ice_bug_report_update_note)]
61pub(crate) struct UpdateNightlyNote;
62
63#[derive(Diagnostic)]
64#[diag(driver_impl_ice_bug_report_internal_feature)]
65pub(crate) struct IceBugReportInternalFeature;
66
67#[derive(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(Diagnostic)]
75#[diag(driver_impl_ice_path)]
76pub(crate) struct IcePath {
77    pub path: std::path::PathBuf,
78}
79
80#[derive(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(Subdiagnostic)]
90#[note(driver_impl_ice_path_error_env)]
91pub(crate) struct IcePathErrorEnv {
92    pub env_var: std::path::PathBuf,
93}
94
95#[derive(Diagnostic)]
96#[diag(driver_impl_ice_flags)]
97pub(crate) struct IceFlags {
98    pub flags: String,
99}
100
101#[derive(Diagnostic)]
102#[diag(driver_impl_ice_exclude_cargo_defaults)]
103pub(crate) struct IceExcludeCargoDefaults;
104
105#[derive(Diagnostic)]
106#[diag(driver_impl_unstable_feature_usage)]
107pub(crate) struct UnstableFeatureUsage {
108    pub error: Box<dyn Error>,
109}