]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_interface/src/errors.rs
Auto merge of #104160 - Ayush1325:windows-args, r=m-ou-se
[rust.git] / compiler / rustc_interface / src / errors.rs
1 use rustc_macros::Diagnostic;
2 use rustc_span::{Span, Symbol};
3
4 use std::io;
5 use std::path::Path;
6
7 #[derive(Diagnostic)]
8 #[diag(interface_ferris_identifier)]
9 pub struct FerrisIdentifier {
10     #[primary_span]
11     pub spans: Vec<Span>,
12     #[suggestion(code = "ferris", applicability = "maybe-incorrect")]
13     pub first_span: Span,
14 }
15
16 #[derive(Diagnostic)]
17 #[diag(interface_emoji_identifier)]
18 pub struct EmojiIdentifier {
19     #[primary_span]
20     pub spans: Vec<Span>,
21     pub ident: Symbol,
22 }
23
24 #[derive(Diagnostic)]
25 #[diag(interface_mixed_bin_crate)]
26 pub struct MixedBinCrate;
27
28 #[derive(Diagnostic)]
29 #[diag(interface_mixed_proc_macro_crate)]
30 pub struct MixedProcMacroCrate;
31
32 #[derive(Diagnostic)]
33 #[diag(interface_proc_macro_doc_without_arg)]
34 pub struct ProcMacroDocWithoutArg;
35
36 #[derive(Diagnostic)]
37 #[diag(interface_error_writing_dependencies)]
38 pub struct ErrorWritingDependencies<'a> {
39     pub path: &'a Path,
40     pub error: io::Error,
41 }
42
43 #[derive(Diagnostic)]
44 #[diag(interface_input_file_would_be_overwritten)]
45 pub struct InputFileWouldBeOverWritten<'a> {
46     pub path: &'a Path,
47 }
48
49 #[derive(Diagnostic)]
50 #[diag(interface_generated_file_conflicts_with_directory)]
51 pub struct GeneratedFileConflictsWithDirectory<'a> {
52     pub input_path: &'a Path,
53     pub dir_path: &'a Path,
54 }
55
56 #[derive(Diagnostic)]
57 #[diag(interface_temps_dir_error)]
58 pub struct TempsDirError;
59
60 #[derive(Diagnostic)]
61 #[diag(interface_out_dir_error)]
62 pub struct OutDirError;
63
64 #[derive(Diagnostic)]
65 #[diag(interface_cant_emit_mir)]
66 pub struct CantEmitMIR {
67     pub error: io::Error,
68 }
69
70 #[derive(Diagnostic)]
71 #[diag(interface_rustc_error_fatal)]
72 pub struct RustcErrorFatal {
73     #[primary_span]
74     pub span: Span,
75 }
76
77 #[derive(Diagnostic)]
78 #[diag(interface_rustc_error_unexpected_annotation)]
79 pub struct RustcErrorUnexpectedAnnotation {
80     #[primary_span]
81     pub span: Span,
82 }
83
84 #[derive(Diagnostic)]
85 #[diag(interface_failed_writing_file)]
86 pub struct FailedWritingFile<'a> {
87     pub path: &'a Path,
88     pub error: io::Error,
89 }