diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:11:28 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:11:28 +0000 |
commit | 94a0819fe3a0d679c3042a77bfe6a2afc505daea (patch) | |
tree | 2b827afe6a05f3538db3f7803a88c4587fe85648 /compiler/rustc_interface/src/errors.rs | |
parent | Adding upstream version 1.64.0+dfsg1. (diff) | |
download | rustc-94a0819fe3a0d679c3042a77bfe6a2afc505daea.tar.xz rustc-94a0819fe3a0d679c3042a77bfe6a2afc505daea.zip |
Adding upstream version 1.66.0+dfsg1.upstream/1.66.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | compiler/rustc_interface/src/errors.rs | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/compiler/rustc_interface/src/errors.rs b/compiler/rustc_interface/src/errors.rs new file mode 100644 index 000000000..f5135c78d --- /dev/null +++ b/compiler/rustc_interface/src/errors.rs @@ -0,0 +1,89 @@ +use rustc_macros::Diagnostic; +use rustc_span::{Span, Symbol}; + +use std::io; +use std::path::Path; + +#[derive(Diagnostic)] +#[diag(interface_ferris_identifier)] +pub struct FerrisIdentifier { + #[primary_span] + pub spans: Vec<Span>, + #[suggestion(code = "ferris", applicability = "maybe-incorrect")] + pub first_span: Span, +} + +#[derive(Diagnostic)] +#[diag(interface_emoji_identifier)] +pub struct EmojiIdentifier { + #[primary_span] + pub spans: Vec<Span>, + pub ident: Symbol, +} + +#[derive(Diagnostic)] +#[diag(interface_mixed_bin_crate)] +pub struct MixedBinCrate; + +#[derive(Diagnostic)] +#[diag(interface_mixed_proc_macro_crate)] +pub struct MixedProcMacroCrate; + +#[derive(Diagnostic)] +#[diag(interface_proc_macro_doc_without_arg)] +pub struct ProcMacroDocWithoutArg; + +#[derive(Diagnostic)] +#[diag(interface_error_writing_dependencies)] +pub struct ErrorWritingDependencies<'a> { + pub path: &'a Path, + pub error: io::Error, +} + +#[derive(Diagnostic)] +#[diag(interface_input_file_would_be_overwritten)] +pub struct InputFileWouldBeOverWritten<'a> { + pub path: &'a Path, +} + +#[derive(Diagnostic)] +#[diag(interface_generated_file_conflicts_with_directory)] +pub struct GeneratedFileConflictsWithDirectory<'a> { + pub input_path: &'a Path, + pub dir_path: &'a Path, +} + +#[derive(Diagnostic)] +#[diag(interface_temps_dir_error)] +pub struct TempsDirError; + +#[derive(Diagnostic)] +#[diag(interface_out_dir_error)] +pub struct OutDirError; + +#[derive(Diagnostic)] +#[diag(interface_cant_emit_mir)] +pub struct CantEmitMIR { + pub error: io::Error, +} + +#[derive(Diagnostic)] +#[diag(interface_rustc_error_fatal)] +pub struct RustcErrorFatal { + #[primary_span] + pub span: Span, +} + +#[derive(Diagnostic)] +#[diag(interface_rustc_error_unexpected_annotation)] +pub struct RustcErrorUnexpectedAnnotation { + #[primary_span] + pub span: Span, +} + +#[derive(Diagnostic)] +#[diag(interface_failed_writing_file)] +pub struct FailedWritingFile<'a> { + pub path: &'a Path, + pub error: io::Error, +} |