2022-08-22 15:58:26 +02:00
|
|
|
use std::io;
|
|
|
|
use std::path::Path;
|
|
|
|
|
2022-09-18 11:46:56 -04:00
|
|
|
use rustc_macros::Diagnostic;
|
2022-08-20 18:30:49 +02:00
|
|
|
use rustc_span::{Span, Symbol};
|
2024-07-29 08:13:50 +10:00
|
|
|
|
2022-09-18 11:46:56 -04:00
|
|
|
#[derive(Diagnostic)]
|
2022-10-22 11:07:54 +02:00
|
|
|
#[diag(interface_ferris_identifier)]
|
2022-08-20 18:30:49 +02:00
|
|
|
pub struct FerrisIdentifier {
|
|
|
|
#[primary_span]
|
|
|
|
pub spans: Vec<Span>,
|
|
|
|
#[suggestion(code = "ferris", applicability = "maybe-incorrect")]
|
|
|
|
pub first_span: Span,
|
|
|
|
}
|
|
|
|
|
2022-09-18 11:46:56 -04:00
|
|
|
#[derive(Diagnostic)]
|
2022-10-22 11:07:54 +02:00
|
|
|
#[diag(interface_emoji_identifier)]
|
2022-08-20 18:30:49 +02:00
|
|
|
pub struct EmojiIdentifier {
|
|
|
|
#[primary_span]
|
|
|
|
pub spans: Vec<Span>,
|
|
|
|
pub ident: Symbol,
|
|
|
|
}
|
2022-08-20 18:33:02 +02:00
|
|
|
|
2022-09-18 11:46:56 -04:00
|
|
|
#[derive(Diagnostic)]
|
2022-10-22 11:07:54 +02:00
|
|
|
#[diag(interface_mixed_bin_crate)]
|
2022-08-20 18:33:02 +02:00
|
|
|
pub struct MixedBinCrate;
|
|
|
|
|
2022-09-18 11:46:56 -04:00
|
|
|
#[derive(Diagnostic)]
|
2022-10-22 11:07:54 +02:00
|
|
|
#[diag(interface_mixed_proc_macro_crate)]
|
2022-08-20 18:33:02 +02:00
|
|
|
pub struct MixedProcMacroCrate;
|
|
|
|
|
2022-09-18 11:46:56 -04:00
|
|
|
#[derive(Diagnostic)]
|
2022-10-22 11:07:54 +02:00
|
|
|
#[diag(interface_error_writing_dependencies)]
|
2022-08-20 18:33:02 +02:00
|
|
|
pub struct ErrorWritingDependencies<'a> {
|
2022-08-22 15:58:26 +02:00
|
|
|
pub path: &'a Path,
|
|
|
|
pub error: io::Error,
|
2022-08-20 18:33:02 +02:00
|
|
|
}
|
|
|
|
|
2022-09-18 11:46:56 -04:00
|
|
|
#[derive(Diagnostic)]
|
2022-10-22 11:07:54 +02:00
|
|
|
#[diag(interface_input_file_would_be_overwritten)]
|
2022-08-20 18:33:02 +02:00
|
|
|
pub struct InputFileWouldBeOverWritten<'a> {
|
2022-08-22 15:58:26 +02:00
|
|
|
pub path: &'a Path,
|
2022-08-20 18:33:02 +02:00
|
|
|
}
|
|
|
|
|
2022-09-18 11:46:56 -04:00
|
|
|
#[derive(Diagnostic)]
|
2022-10-22 11:07:54 +02:00
|
|
|
#[diag(interface_generated_file_conflicts_with_directory)]
|
2022-08-20 18:33:02 +02:00
|
|
|
pub struct GeneratedFileConflictsWithDirectory<'a> {
|
2022-08-22 15:58:26 +02:00
|
|
|
pub input_path: &'a Path,
|
|
|
|
pub dir_path: &'a Path,
|
2022-08-20 18:33:02 +02:00
|
|
|
}
|
|
|
|
|
2022-09-18 11:46:56 -04:00
|
|
|
#[derive(Diagnostic)]
|
2022-10-22 11:07:54 +02:00
|
|
|
#[diag(interface_temps_dir_error)]
|
2022-08-20 18:33:02 +02:00
|
|
|
pub struct TempsDirError;
|
|
|
|
|
2022-09-18 11:46:56 -04:00
|
|
|
#[derive(Diagnostic)]
|
2022-10-22 11:07:54 +02:00
|
|
|
#[diag(interface_out_dir_error)]
|
2022-08-20 18:33:02 +02:00
|
|
|
pub struct OutDirError;
|
|
|
|
|
2022-09-18 11:46:56 -04:00
|
|
|
#[derive(Diagnostic)]
|
2022-10-22 11:07:54 +02:00
|
|
|
#[diag(interface_cant_emit_mir)]
|
2022-08-22 15:58:26 +02:00
|
|
|
pub struct CantEmitMIR {
|
|
|
|
pub error: io::Error,
|
2022-08-20 18:33:02 +02:00
|
|
|
}
|
|
|
|
|
2022-09-18 11:46:56 -04:00
|
|
|
#[derive(Diagnostic)]
|
2022-10-22 11:07:54 +02:00
|
|
|
#[diag(interface_rustc_error_fatal)]
|
2022-08-20 18:33:02 +02:00
|
|
|
pub struct RustcErrorFatal {
|
|
|
|
#[primary_span]
|
|
|
|
pub span: Span,
|
|
|
|
}
|
|
|
|
|
2022-09-18 11:46:56 -04:00
|
|
|
#[derive(Diagnostic)]
|
2022-10-22 11:07:54 +02:00
|
|
|
#[diag(interface_rustc_error_unexpected_annotation)]
|
2022-08-20 18:33:02 +02:00
|
|
|
pub struct RustcErrorUnexpectedAnnotation {
|
|
|
|
#[primary_span]
|
|
|
|
pub span: Span,
|
|
|
|
}
|
|
|
|
|
2022-09-18 11:46:56 -04:00
|
|
|
#[derive(Diagnostic)]
|
2022-10-22 11:07:54 +02:00
|
|
|
#[diag(interface_failed_writing_file)]
|
2022-08-20 18:33:02 +02:00
|
|
|
pub struct FailedWritingFile<'a> {
|
2022-08-22 15:58:26 +02:00
|
|
|
pub path: &'a Path,
|
|
|
|
pub error: io::Error,
|
2022-08-20 18:33:02 +02:00
|
|
|
}
|
2023-01-10 13:57:42 +01:00
|
|
|
|
|
|
|
#[derive(Diagnostic)]
|
|
|
|
#[diag(interface_proc_macro_crate_panic_abort)]
|
|
|
|
pub struct ProcMacroCratePanicAbort;
|
2022-08-19 14:48:15 +01:00
|
|
|
|
|
|
|
#[derive(Diagnostic)]
|
|
|
|
#[diag(interface_multiple_output_types_adaption)]
|
|
|
|
pub struct MultipleOutputTypesAdaption;
|
|
|
|
|
|
|
|
#[derive(Diagnostic)]
|
|
|
|
#[diag(interface_ignoring_extra_filename)]
|
|
|
|
pub struct IgnoringExtraFilename;
|
|
|
|
|
|
|
|
#[derive(Diagnostic)]
|
|
|
|
#[diag(interface_ignoring_out_dir)]
|
|
|
|
pub struct IgnoringOutDir;
|
2023-02-26 15:27:27 -05:00
|
|
|
|
|
|
|
#[derive(Diagnostic)]
|
|
|
|
#[diag(interface_multiple_output_types_to_stdout)]
|
|
|
|
pub struct MultipleOutputTypesToStdout;
|
2025-01-27 18:30:17 +01:00
|
|
|
|
|
|
|
#[derive(Diagnostic)]
|
|
|
|
#[diag(interface_abi_required_feature)]
|
|
|
|
#[note]
|
|
|
|
#[note(interface_abi_required_feature_issue)]
|
|
|
|
pub(crate) struct AbiRequiredTargetFeature<'a> {
|
|
|
|
pub feature: &'a str,
|
|
|
|
pub enabled: &'a str,
|
|
|
|
}
|