mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-06 15:07:36 +00:00

Here I am assuming we want to treat these parameters (input, first, second, third, return) as translatable
43 lines
1.0 KiB
Rust
43 lines
1.0 KiB
Rust
use rustc_errors::{DiagnosticArgValue, IntoDiagnosticArg};
|
|
use rustc_macros::Diagnostic;
|
|
use rustc_span::Span;
|
|
use std::borrow::Cow;
|
|
|
|
struct ExitCode(Option<i32>);
|
|
|
|
impl IntoDiagnosticArg for ExitCode {
|
|
fn into_diagnostic_arg(self) -> DiagnosticArgValue<'static> {
|
|
let ExitCode(exit_code) = self;
|
|
match exit_code {
|
|
Some(t) => t.into_diagnostic_arg(),
|
|
None => DiagnosticArgValue::Str(Cow::Borrowed("<signal>")),
|
|
}
|
|
}
|
|
}
|
|
|
|
#[derive(Diagnostic)]
|
|
#[diag(codegen_gcc_lto_not_supported)]
|
|
pub(crate) struct LTONotSupported;
|
|
|
|
#[derive(Diagnostic)]
|
|
#[diag(codegen_gcc_unwinding_inline_asm)]
|
|
pub(crate) struct UnwindingInlineAsm {
|
|
#[primary_span]
|
|
pub span: Span,
|
|
}
|
|
|
|
#[derive(Diagnostic)]
|
|
#[diag(codegen_gcc_invalid_minimum_alignment)]
|
|
pub(crate) struct InvalidMinimumAlignment {
|
|
pub err: String,
|
|
}
|
|
|
|
#[derive(Diagnostic)]
|
|
#[diag(codegen_gcc_tied_target_features)]
|
|
#[help]
|
|
pub(crate) struct TiedTargetFeatures {
|
|
#[primary_span]
|
|
pub span: Span,
|
|
pub features: String,
|
|
}
|