rustc_driver_impl/
session_diagnostics.rs
1use std::error::Error;
2
3use rustc_macros::{Diagnostic, Subdiagnostic};
4
5#[derive(Diagnostic)]
6#[diag(driver_impl_rlink_unable_to_read)]
7pub(crate) struct RlinkUnableToRead {
8 pub err: std::io::Error,
9}
10
11#[derive(Diagnostic)]
12#[diag(driver_impl_rlink_wrong_file_type)]
13pub(crate) struct RLinkWrongFileType;
14
15#[derive(Diagnostic)]
16#[diag(driver_impl_rlink_empty_version_number)]
17pub(crate) struct RLinkEmptyVersionNumber;
18
19#[derive(Diagnostic)]
20#[diag(driver_impl_rlink_encoding_version_mismatch)]
21pub(crate) struct RLinkEncodingVersionMismatch {
22 pub version_array: String,
23 pub rlink_version: u32,
24}
25
26#[derive(Diagnostic)]
27#[diag(driver_impl_rlink_rustc_version_mismatch)]
28pub(crate) struct RLinkRustcVersionMismatch<'a> {
29 pub rustc_version: String,
30 pub current_version: &'a str,
31}
32
33#[derive(Diagnostic)]
34#[diag(driver_impl_rlink_no_a_file)]
35pub(crate) struct RlinkNotAFile;
36
37#[derive(Diagnostic)]
38#[diag(driver_impl_rlink_corrupt_file)]
39pub(crate) struct RlinkCorruptFile<'a> {
40 pub file: &'a std::path::Path,
41}
42
43#[derive(Diagnostic)]
44#[diag(driver_impl_ice)]
45pub(crate) struct Ice;
46
47#[derive(Diagnostic)]
48#[diag(driver_impl_ice_bug_report)]
49pub(crate) struct IceBugReport<'a> {
50 pub bug_report_url: &'a str,
51}
52
53#[derive(Diagnostic)]
54#[diag(driver_impl_ice_bug_report_update_note)]
55pub(crate) struct UpdateNightlyNote;
56
57#[derive(Diagnostic)]
58#[diag(driver_impl_ice_bug_report_internal_feature)]
59pub(crate) struct IceBugReportInternalFeature;
60
61#[derive(Diagnostic)]
62#[diag(driver_impl_ice_version)]
63pub(crate) struct IceVersion<'a> {
64 pub version: &'a str,
65 pub triple: &'a str,
66}
67
68#[derive(Diagnostic)]
69#[diag(driver_impl_ice_path)]
70pub(crate) struct IcePath {
71 pub path: std::path::PathBuf,
72}
73
74#[derive(Diagnostic)]
75#[diag(driver_impl_ice_path_error)]
76pub(crate) struct IcePathError {
77 pub path: std::path::PathBuf,
78 pub error: String,
79 #[subdiagnostic]
80 pub env_var: Option<IcePathErrorEnv>,
81}
82
83#[derive(Subdiagnostic)]
84#[note(driver_impl_ice_path_error_env)]
85pub(crate) struct IcePathErrorEnv {
86 pub env_var: std::path::PathBuf,
87}
88
89#[derive(Diagnostic)]
90#[diag(driver_impl_ice_flags)]
91pub(crate) struct IceFlags {
92 pub flags: String,
93}
94
95#[derive(Diagnostic)]
96#[diag(driver_impl_ice_exclude_cargo_defaults)]
97pub(crate) struct IceExcludeCargoDefaults;
98
99#[derive(Diagnostic)]
100#[diag(driver_impl_unstable_feature_usage)]
101pub(crate) struct UnstableFeatureUsage {
102 pub error: Box<dyn Error>,
103}