mirror of
https://github.com/rust-lang/rust.git
synced 2025-10-11 14:48:41 +00:00

`rustc_codegen_llvm` and `rustc_codegen_gcc` duplicated logic for checking if tied target features were partially enabled. This commit consolidates these checks into `rustc_codegen_ssa` in the `codegen_fn_attrs` query, which also is run pre-monomorphisation for each function, which ensures that this check is run for unused functions, as would be expected.
69 lines
1.5 KiB
Rust
69 lines
1.5 KiB
Rust
use rustc_macros::{Diagnostic, Subdiagnostic};
|
|
use rustc_span::Span;
|
|
|
|
#[derive(Diagnostic)]
|
|
#[diag(codegen_gcc_unknown_ctarget_feature_prefix)]
|
|
#[note]
|
|
pub(crate) struct UnknownCTargetFeaturePrefix<'a> {
|
|
pub feature: &'a str,
|
|
}
|
|
|
|
#[derive(Diagnostic)]
|
|
#[diag(codegen_gcc_unknown_ctarget_feature)]
|
|
#[note]
|
|
pub(crate) struct UnknownCTargetFeature<'a> {
|
|
pub feature: &'a str,
|
|
#[subdiagnostic]
|
|
pub rust_feature: PossibleFeature<'a>,
|
|
}
|
|
|
|
#[derive(Subdiagnostic)]
|
|
pub(crate) enum PossibleFeature<'a> {
|
|
#[help(codegen_gcc_possible_feature)]
|
|
Some { rust_feature: &'a str },
|
|
#[help(codegen_gcc_consider_filing_feature_request)]
|
|
None,
|
|
}
|
|
|
|
#[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_copy_bitcode)]
|
|
pub(crate) struct CopyBitcode {
|
|
pub err: std::io::Error,
|
|
}
|
|
|
|
#[derive(Diagnostic)]
|
|
#[diag(codegen_gcc_dynamic_linking_with_lto)]
|
|
#[note]
|
|
pub(crate) struct DynamicLinkingWithLTO;
|
|
|
|
#[derive(Diagnostic)]
|
|
#[diag(codegen_gcc_lto_disallowed)]
|
|
pub(crate) struct LtoDisallowed;
|
|
|
|
#[derive(Diagnostic)]
|
|
#[diag(codegen_gcc_lto_dylib)]
|
|
pub(crate) struct LtoDylib;
|
|
|
|
#[derive(Diagnostic)]
|
|
#[diag(codegen_gcc_lto_bitcode_from_rlib)]
|
|
pub(crate) struct LtoBitcodeFromRlib {
|
|
pub gcc_err: String,
|
|
}
|