Skip to main content

rustc_incremental/
diagnostics.rs

1use std::path::{Path, PathBuf};
2
3use rustc_macros::Diagnostic;
4use rustc_span::{Span, Symbol};
5
6#[derive(const _: () =
    {
        impl<'_sess> rustc_errors::Diagnostic<'_sess> for UnrecognizedDepNode
            {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess> {
                match self {
                    UnrecognizedDepNode { span: __binding_0, name: __binding_1 }
                        => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("unrecognized `DepNode` variant: {$name}")));
                        ;
                        diag.arg("name", __binding_1);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
7#[diag("unrecognized `DepNode` variant: {$name}")]
8pub(crate) struct UnrecognizedDepNode {
9    #[primary_span]
10    pub span: Span,
11    pub name: Symbol,
12}
13
14#[derive(const _: () =
    {
        impl<'_sess> rustc_errors::Diagnostic<'_sess> for MissingIfThisChanged
            {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess> {
                match self {
                    MissingIfThisChanged { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("no `#[rustc_if_this_changed]` annotation detected")));
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
15#[diag("no `#[rustc_if_this_changed]` annotation detected")]
16pub(crate) struct MissingIfThisChanged {
17    #[primary_span]
18    pub span: Span,
19}
20
21#[derive(const _: () =
    {
        impl<'_sess> rustc_errors::Diagnostic<'_sess> for Ok {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess> {
                match self {
                    Ok { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("OK")));
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
22#[diag("OK")]
23pub(crate) struct Ok {
24    #[primary_span]
25    pub span: Span,
26}
27
28#[derive(const _: () =
    {
        impl<'_sess> rustc_errors::Diagnostic<'_sess> for NoPath {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess> {
                match self {
                    NoPath {
                        span: __binding_0, target: __binding_1, source: __binding_2
                        } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("no path from `{$source}` to `{$target}`")));
                        ;
                        diag.arg("target", __binding_1);
                        diag.arg("source", __binding_2);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
29#[diag("no path from `{$source}` to `{$target}`")]
30pub(crate) struct NoPath {
31    #[primary_span]
32    pub span: Span,
33    pub target: Symbol,
34    pub source: String,
35}
36
37#[derive(const _: () =
    {
        impl<'_sess, 'a> rustc_errors::Diagnostic<'_sess> for
            AssertionAuto<'a> {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess> {
                match self {
                    AssertionAuto {
                        span: __binding_0, name: __binding_1, e: __binding_2 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`except` specified DepNodes that can not be affected for \"{$name}\": \"{$e}\"")));
                        ;
                        diag.arg("name", __binding_1);
                        diag.arg("e", __binding_2);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
38#[diag("`except` specified DepNodes that can not be affected for \"{$name}\": \"{$e}\"")]
39pub(crate) struct AssertionAuto<'a> {
40    #[primary_span]
41    pub span: Span,
42    pub name: &'a str,
43    pub e: &'a str,
44}
45
46#[derive(const _: () =
    {
        impl<'_sess> rustc_errors::Diagnostic<'_sess> for
            UndefinedCleanDirtyItem {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess> {
                match self {
                    UndefinedCleanDirtyItem {
                        span: __binding_0, kind: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("clean/dirty auto-assertions not yet defined for Node::Item.node={$kind}")));
                        ;
                        diag.arg("kind", __binding_1);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
47#[diag("clean/dirty auto-assertions not yet defined for Node::Item.node={$kind}")]
48pub(crate) struct UndefinedCleanDirtyItem {
49    #[primary_span]
50    pub span: Span,
51    pub kind: String,
52}
53
54#[derive(const _: () =
    {
        impl<'_sess> rustc_errors::Diagnostic<'_sess> for UndefinedCleanDirty
            {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess> {
                match self {
                    UndefinedCleanDirty { span: __binding_0, kind: __binding_1 }
                        => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("clean/dirty auto-assertions not yet defined for {$kind}")));
                        ;
                        diag.arg("kind", __binding_1);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
55#[diag("clean/dirty auto-assertions not yet defined for {$kind}")]
56pub(crate) struct UndefinedCleanDirty {
57    #[primary_span]
58    pub span: Span,
59    pub kind: String,
60}
61
62#[derive(const _: () =
    {
        impl<'_sess, 'a> rustc_errors::Diagnostic<'_sess> for
            RepeatedDepNodeLabel<'a> {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess> {
                match self {
                    RepeatedDepNodeLabel { span: __binding_0, label: __binding_1
                        } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("dep-node label `{$label}` is repeated")));
                        ;
                        diag.arg("label", __binding_1);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
63#[diag("dep-node label `{$label}` is repeated")]
64pub(crate) struct RepeatedDepNodeLabel<'a> {
65    #[primary_span]
66    pub span: Span,
67    pub label: &'a str,
68}
69
70#[derive(const _: () =
    {
        impl<'_sess, 'a> rustc_errors::Diagnostic<'_sess> for
            UnrecognizedDepNodeLabel<'a> {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess> {
                match self {
                    UnrecognizedDepNodeLabel {
                        span: __binding_0, label: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("dep-node label `{$label}` not recognized")));
                        ;
                        diag.arg("label", __binding_1);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
71#[diag("dep-node label `{$label}` not recognized")]
72pub(crate) struct UnrecognizedDepNodeLabel<'a> {
73    #[primary_span]
74    pub span: Span,
75    pub label: &'a str,
76}
77
78#[derive(const _: () =
    {
        impl<'_sess, 'a> rustc_errors::Diagnostic<'_sess> for NotDirty<'a> {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess> {
                match self {
                    NotDirty { span: __binding_0, dep_node_str: __binding_1 } =>
                        {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`{$dep_node_str}` should be dirty but is not")));
                        ;
                        diag.arg("dep_node_str", __binding_1);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
79#[diag("`{$dep_node_str}` should be dirty but is not")]
80pub(crate) struct NotDirty<'a> {
81    #[primary_span]
82    pub span: Span,
83    pub dep_node_str: &'a str,
84}
85
86#[derive(const _: () =
    {
        impl<'_sess, 'a> rustc_errors::Diagnostic<'_sess> for NotClean<'a> {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess> {
                match self {
                    NotClean { span: __binding_0, dep_node_str: __binding_1 } =>
                        {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`{$dep_node_str}` should be clean but is not")));
                        ;
                        diag.arg("dep_node_str", __binding_1);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
87#[diag("`{$dep_node_str}` should be clean but is not")]
88pub(crate) struct NotClean<'a> {
89    #[primary_span]
90    pub span: Span,
91    pub dep_node_str: &'a str,
92}
93
94#[derive(const _: () =
    {
        impl<'_sess, 'a> rustc_errors::Diagnostic<'_sess> for NotLoaded<'a> {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess> {
                match self {
                    NotLoaded { span: __binding_0, dep_node_str: __binding_1 }
                        => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("`{$dep_node_str}` should have been loaded from disk but it was not")));
                        ;
                        diag.arg("dep_node_str", __binding_1);
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
95#[diag("`{$dep_node_str}` should have been loaded from disk but it was not")]
96pub(crate) struct NotLoaded<'a> {
97    #[primary_span]
98    pub span: Span,
99    pub dep_node_str: &'a str,
100}
101
102#[derive(const _: () =
    {
        impl<'_sess> rustc_errors::Diagnostic<'_sess> for UncheckedClean {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess> {
                match self {
                    UncheckedClean { span: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("found unchecked `#[rustc_clean]` attribute")));
                        ;
                        diag.span(__binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
103#[diag("found unchecked `#[rustc_clean]` attribute")]
104pub(crate) struct UncheckedClean {
105    #[primary_span]
106    pub span: Span,
107}
108#[derive(const _: () =
    {
        impl<'_sess, 'a> rustc_errors::Diagnostic<'_sess> for DeleteOld<'a> {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess> {
                match self {
                    DeleteOld {
                        name: __binding_0, path: __binding_1, err: __binding_2 } =>
                        {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("unable to delete old {$name} at `{$path}`: {$err}")));
                        ;
                        diag.arg("name", __binding_0);
                        diag.arg("path", __binding_1);
                        diag.arg("err", __binding_2);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
109#[diag("unable to delete old {$name} at `{$path}`: {$err}")]
110pub(crate) struct DeleteOld<'a> {
111    pub name: &'a str,
112    pub path: PathBuf,
113    pub err: std::io::Error,
114}
115
116#[derive(const _: () =
    {
        impl<'_sess, 'a> rustc_errors::Diagnostic<'_sess> for CreateNew<'a> {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess> {
                match self {
                    CreateNew {
                        name: __binding_0, path: __binding_1, err: __binding_2 } =>
                        {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("failed to create {$name} at `{$path}`: {$err}")));
                        ;
                        diag.arg("name", __binding_0);
                        diag.arg("path", __binding_1);
                        diag.arg("err", __binding_2);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
117#[diag("failed to create {$name} at `{$path}`: {$err}")]
118pub(crate) struct CreateNew<'a> {
119    pub name: &'a str,
120    pub path: PathBuf,
121    pub err: std::io::Error,
122}
123
124#[derive(const _: () =
    {
        impl<'_sess, 'a> rustc_errors::Diagnostic<'_sess> for WriteNew<'a> {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess> {
                match self {
                    WriteNew {
                        name: __binding_0, path: __binding_1, err: __binding_2 } =>
                        {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("failed to write {$name} to `{$path}`: {$err}")));
                        ;
                        diag.arg("name", __binding_0);
                        diag.arg("path", __binding_1);
                        diag.arg("err", __binding_2);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
125#[diag("failed to write {$name} to `{$path}`: {$err}")]
126pub(crate) struct WriteNew<'a> {
127    pub name: &'a str,
128    pub path: PathBuf,
129    pub err: std::io::Error,
130}
131
132#[derive(const _: () =
    {
        impl<'_sess> rustc_errors::Diagnostic<'_sess> for CanonicalizePath {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess> {
                match self {
                    CanonicalizePath { path: __binding_0, err: __binding_1 } =>
                        {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("incremental compilation: error canonicalizing path `{$path}`: {$err}")));
                        ;
                        diag.arg("path", __binding_0);
                        diag.arg("err", __binding_1);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
133#[diag("incremental compilation: error canonicalizing path `{$path}`: {$err}")]
134pub(crate) struct CanonicalizePath {
135    pub path: PathBuf,
136    pub err: std::io::Error,
137}
138
139#[derive(const _: () =
    {
        impl<'_sess, 'a> rustc_errors::Diagnostic<'_sess> for
            CreateIncrCompDir<'a> {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess> {
                match self {
                    CreateIncrCompDir {
                        tag: __binding_0, path: __binding_1, err: __binding_2 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("could not create incremental compilation {$tag} directory `{$path}`: {$err}")));
                        ;
                        diag.arg("tag", __binding_0);
                        diag.arg("path", __binding_1);
                        diag.arg("err", __binding_2);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
140#[diag("could not create incremental compilation {$tag} directory `{$path}`: {$err}")]
141pub(crate) struct CreateIncrCompDir<'a> {
142    pub tag: &'a str,
143    pub path: &'a Path,
144    pub err: std::io::Error,
145}
146
147#[derive(const _: () =
    {
        impl<'_sess, 'a> rustc_errors::Diagnostic<'_sess> for CreateLock<'a> {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess> {
                match self {
                    CreateLock {
                        lock_err: __binding_0,
                        session_dir: __binding_1,
                        is_unsupported_lock: __binding_2,
                        is_cargo: __binding_3 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("incremental compilation: could not create session directory lock file: {$lock_err}")));
                        ;
                        diag.arg("lock_err", __binding_0);
                        diag.arg("session_dir", __binding_1);
                        if __binding_2 {
                            diag.note(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the filesystem for the incremental path at {$session_dir} does not appear to support locking, consider changing the incremental path to a filesystem that supports locking or disable incremental compilation")));
                        }
                        if __binding_3 {
                            diag.help(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("incremental compilation can be disabled by setting the environment variable CARGO_INCREMENTAL=0 (see https://doc.rust-lang.org/cargo/reference/profiles.html#incremental)")));
                        }
                        if __binding_3 {
                            diag.help(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the entire build directory can be changed to a different filesystem by setting the environment variable CARGO_TARGET_DIR to a different path (see https://doc.rust-lang.org/cargo/reference/config.html#buildtarget-dir)")));
                        }
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
148#[diag("incremental compilation: could not create session directory lock file: {$lock_err}")]
149pub(crate) struct CreateLock<'a> {
150    pub lock_err: std::io::Error,
151    pub session_dir: &'a Path,
152    #[note(
153        "the filesystem for the incremental path at {$session_dir} does not appear to support locking, consider changing the incremental path to a filesystem that supports locking or disable incremental compilation"
154    )]
155    pub is_unsupported_lock: bool,
156    #[help(
157        "incremental compilation can be disabled by setting the environment variable CARGO_INCREMENTAL=0 (see https://doc.rust-lang.org/cargo/reference/profiles.html#incremental)"
158    )]
159    #[help(
160        "the entire build directory can be changed to a different filesystem by setting the environment variable CARGO_TARGET_DIR to a different path (see https://doc.rust-lang.org/cargo/reference/config.html#buildtarget-dir)"
161    )]
162    pub is_cargo: bool,
163}
164
165#[derive(const _: () =
    {
        impl<'_sess, 'a> rustc_errors::Diagnostic<'_sess> for DeleteLock<'a> {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess> {
                match self {
                    DeleteLock { path: __binding_0, err: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("error deleting lock file for incremental compilation session directory `{$path}`: {$err}")));
                        ;
                        diag.arg("path", __binding_0);
                        diag.arg("err", __binding_1);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
166#[diag("error deleting lock file for incremental compilation session directory `{$path}`: {$err}")]
167pub(crate) struct DeleteLock<'a> {
168    pub path: &'a Path,
169    pub err: std::io::Error,
170}
171
172#[derive(const _: () =
    {
        impl<'_sess, 'a> rustc_errors::Diagnostic<'_sess> for Finalize<'a> {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess> {
                match self {
                    Finalize { path: __binding_0, err: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("did not finalize incremental compilation session directory `{$path}`: {$err}")));
                        diag.help(rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("the next build will not be able to reuse work from this compilation")));
                        ;
                        diag.arg("path", __binding_0);
                        diag.arg("err", __binding_1);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
173#[diag("did not finalize incremental compilation session directory `{$path}`: {$err}")]
174#[help("the next build will not be able to reuse work from this compilation")]
175pub(crate) struct Finalize<'a> {
176    pub path: &'a Path,
177    pub err: std::io::Error,
178}
179
180#[derive(const _: () =
    {
        impl<'_sess, 'a> rustc_errors::Diagnostic<'_sess> for
            InvalidGcFailed<'a> {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess> {
                match self {
                    InvalidGcFailed { path: __binding_0, err: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("failed to garbage collect invalid incremental compilation session directory `{$path}`: {$err}")));
                        ;
                        diag.arg("path", __binding_0);
                        diag.arg("err", __binding_1);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
181#[diag(
182    "failed to garbage collect invalid incremental compilation session directory `{$path}`: {$err}"
183)]
184pub(crate) struct InvalidGcFailed<'a> {
185    pub path: &'a Path,
186    pub err: std::io::Error,
187}
188
189#[derive(const _: () =
    {
        impl<'_sess, 'a> rustc_errors::Diagnostic<'_sess> for
            FinalizedGcFailed<'a> {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess> {
                match self {
                    FinalizedGcFailed { path: __binding_0, err: __binding_1 } =>
                        {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("failed to garbage collect finalized incremental compilation session directory `{$path}`: {$err}")));
                        ;
                        diag.arg("path", __binding_0);
                        diag.arg("err", __binding_1);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
190#[diag(
191    "failed to garbage collect finalized incremental compilation session directory `{$path}`: {$err}"
192)]
193pub(crate) struct FinalizedGcFailed<'a> {
194    pub path: &'a Path,
195    pub err: std::io::Error,
196}
197
198#[derive(const _: () =
    {
        impl<'_sess, 'a> rustc_errors::Diagnostic<'_sess> for
            SessionGcFailed<'a> {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess> {
                match self {
                    SessionGcFailed { path: __binding_0, err: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("failed to garbage collect incremental compilation session directory `{$path}`: {$err}")));
                        ;
                        diag.arg("path", __binding_0);
                        diag.arg("err", __binding_1);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
199#[diag("failed to garbage collect incremental compilation session directory `{$path}`: {$err}")]
200pub(crate) struct SessionGcFailed<'a> {
201    pub path: &'a Path,
202    pub err: std::io::Error,
203}
204
205#[derive(const _: () =
    {
        impl<'_sess> rustc_errors::Diagnostic<'_sess> for AssertNotLoaded {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess> {
                match self {
                    AssertNotLoaded => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("we asserted that the incremental cache should not be loaded, but it was loaded")));
                        ;
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
206#[diag("we asserted that the incremental cache should not be loaded, but it was loaded")]
207pub(crate) struct AssertNotLoaded;
208
209#[derive(const _: () =
    {
        impl<'_sess> rustc_errors::Diagnostic<'_sess> for AssertLoaded {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess> {
                match self {
                    AssertLoaded => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("we asserted that an existing incremental cache directory should be successfully loaded, but it was not")));
                        ;
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
210#[diag(
211    "we asserted that an existing incremental cache directory should be successfully loaded, but it was not"
212)]
213pub(crate) struct AssertLoaded;
214
215#[derive(const _: () =
    {
        impl<'_sess> rustc_errors::Diagnostic<'_sess> for DeleteIncompatible {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess> {
                match self {
                    DeleteIncompatible { path: __binding_0, err: __binding_1 }
                        => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("failed to delete invalidated or incompatible incremental compilation session directory contents `{$path}`: {$err}")));
                        ;
                        diag.arg("path", __binding_0);
                        diag.arg("err", __binding_1);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
216#[diag(
217    "failed to delete invalidated or incompatible incremental compilation session directory contents `{$path}`: {$err}"
218)]
219pub(crate) struct DeleteIncompatible {
220    pub path: PathBuf,
221    pub err: std::io::Error,
222}
223
224#[derive(const _: () =
    {
        impl<'_sess> rustc_errors::Diagnostic<'_sess> for LoadDepGraph {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess> {
                match self {
                    LoadDepGraph { path: __binding_0, err: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("could not load dep-graph from `{$path}`: {$err}")));
                        ;
                        diag.arg("path", __binding_0);
                        diag.arg("err", __binding_1);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
225#[diag("could not load dep-graph from `{$path}`: {$err}")]
226pub(crate) struct LoadDepGraph {
227    pub path: PathBuf,
228    pub err: std::io::Error,
229}
230
231#[derive(const _: () =
    {
        impl<'_sess, 'a> rustc_errors::Diagnostic<'_sess> for MoveDepGraph<'a>
            {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess> {
                match self {
                    MoveDepGraph {
                        from: __binding_0, to: __binding_1, err: __binding_2 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("failed to move dependency graph from `{$from}` to `{$to}`: {$err}")));
                        ;
                        diag.arg("from", __binding_0);
                        diag.arg("to", __binding_1);
                        diag.arg("err", __binding_2);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
232#[diag("failed to move dependency graph from `{$from}` to `{$to}`: {$err}")]
233pub(crate) struct MoveDepGraph<'a> {
234    pub from: &'a Path,
235    pub to: &'a Path,
236    pub err: std::io::Error,
237}
238
239#[derive(const _: () =
    {
        impl<'_sess, 'a> rustc_errors::Diagnostic<'_sess> for
            CreateDepGraph<'a> {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess> {
                match self {
                    CreateDepGraph { path: __binding_0, err: __binding_1 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("failed to create dependency graph at `{$path}`: {$err}")));
                        ;
                        diag.arg("path", __binding_0);
                        diag.arg("err", __binding_1);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
240#[diag("failed to create dependency graph at `{$path}`: {$err}")]
241pub(crate) struct CreateDepGraph<'a> {
242    pub path: &'a Path,
243    pub err: std::io::Error,
244}
245
246#[derive(const _: () =
    {
        impl<'_sess, 'a> rustc_errors::Diagnostic<'_sess> for
            CopyWorkProductToCache<'a> {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess> {
                match self {
                    CopyWorkProductToCache {
                        from: __binding_0, to: __binding_1, err: __binding_2 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("error copying object file `{$from}` to incremental directory as `{$to}`: {$err}")));
                        ;
                        diag.arg("from", __binding_0);
                        diag.arg("to", __binding_1);
                        diag.arg("err", __binding_2);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
247#[diag("error copying object file `{$from}` to incremental directory as `{$to}`: {$err}")]
248pub(crate) struct CopyWorkProductToCache<'a> {
249    pub from: &'a Path,
250    pub to: &'a Path,
251    pub err: std::io::Error,
252}
253
254#[derive(const _: () =
    {
        impl<'_sess, 'a> rustc_errors::Diagnostic<'_sess> for CorruptFile<'a>
            {
            #[track_caller]
            fn into_diag(self, dcx: rustc_errors::DiagCtxtHandle<'_sess>,
                level: rustc_errors::Level) -> rustc_errors::Diag<'_sess> {
                match self {
                    CorruptFile { path: __binding_0 } => {
                        let mut diag =
                            rustc_errors::Diag::new(dcx, level,
                                rustc_errors::DiagMessage::Inline(std::borrow::Cow::Borrowed("corrupt incremental compilation artifact found at `{$path}`. This file will automatically be ignored and deleted. If you see this message repeatedly or can provoke it without manually manipulating the compiler's artifacts, please file an issue. The incremental compilation system relies on hardlinks and filesystem locks behaving correctly, and may not deal well with OS crashes, so whatever information you can provide about your filesystem or other state may be very relevant")));
                        ;
                        diag.arg("path", __binding_0);
                        diag
                    }
                }
            }
        }
    };Diagnostic)]
255#[diag(
256    "corrupt incremental compilation artifact found at `{$path}`. This file will automatically be ignored and deleted. If you see this message repeatedly or can provoke it without manually manipulating the compiler's artifacts, please file an issue. The incremental compilation system relies on hardlinks and filesystem locks behaving correctly, and may not deal well with OS crashes, so whatever information you can provide about your filesystem or other state may be very relevant"
257)]
258pub(crate) struct CorruptFile<'a> {
259    pub path: &'a Path,
260}