2022-09-01 05:02:35 +00:00
|
|
|
use rustc_errors::{DiagnosticArgValue, IntoDiagnosticArg};
|
2022-09-24 18:05:37 +00:00
|
|
|
use rustc_macros::Diagnostic;
|
2023-07-20 04:20:00 +00:00
|
|
|
use rustc_span::Span;
|
2022-09-01 05:02:35 +00:00
|
|
|
use std::borrow::Cow;
|
|
|
|
|
2022-09-27 02:57:40 +00:00
|
|
|
struct ExitCode(Option<i32>);
|
2022-09-01 05:02:35 +00:00
|
|
|
|
|
|
|
impl IntoDiagnosticArg for ExitCode {
|
|
|
|
fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> {
|
2022-09-27 02:57:40 +00:00
|
|
|
let ExitCode(exit_code) = self;
|
|
|
|
match exit_code {
|
2022-09-01 05:02:35 +00:00
|
|
|
Some(t) => t.into_diagnostic_arg(),
|
2022-09-29 02:02:38 +00:00
|
|
|
None => DiagnosticArgValue::Str(Cow::Borrowed("<signal>")),
|
2022-09-01 05:02:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2022-08-27 02:32:04 +00:00
|
|
|
|
2022-09-24 18:05:37 +00:00
|
|
|
#[derive(Diagnostic)]
|
2022-10-22 09:07:54 +00:00
|
|
|
#[diag(codegen_gcc_lto_not_supported)]
|
2022-09-01 05:03:05 +00:00
|
|
|
pub(crate) struct LTONotSupported;
|
2022-08-27 03:50:37 +00:00
|
|
|
|
2022-09-24 18:05:37 +00:00
|
|
|
#[derive(Diagnostic)]
|
2022-10-22 09:07:54 +00:00
|
|
|
#[diag(codegen_gcc_unwinding_inline_asm)]
|
2022-08-27 03:44:44 +00:00
|
|
|
pub(crate) struct UnwindingInlineAsm {
|
|
|
|
#[primary_span]
|
2022-05-28 10:43:51 +00:00
|
|
|
pub span: Span,
|
2022-08-27 03:44:44 +00:00
|
|
|
}
|
2023-03-05 17:03:19 +00:00
|
|
|
|
|
|
|
#[derive(Diagnostic)]
|
|
|
|
#[diag(codegen_gcc_invalid_minimum_alignment)]
|
|
|
|
pub(crate) struct InvalidMinimumAlignment {
|
|
|
|
pub err: String,
|
|
|
|
}
|
2023-03-05 17:31:16 +00:00
|
|
|
|
|
|
|
#[derive(Diagnostic)]
|
|
|
|
#[diag(codegen_gcc_tied_target_features)]
|
|
|
|
#[help]
|
|
|
|
pub(crate) struct TiedTargetFeatures {
|
|
|
|
#[primary_span]
|
|
|
|
pub span: Span,
|
|
|
|
pub features: String,
|
|
|
|
}
|