Formatting

This commit is contained in:
SLASHLogin 2022-08-25 15:42:20 +02:00
parent 575f6098da
commit a54c8003ab
2 changed files with 14 additions and 6 deletions

View File

@ -1,6 +1,6 @@
use rustc_errors::fluent;
use rustc_errors::DiagnosticBuilder;
use rustc_session::SessionDiagnostic;
use rustc_errors::fluent;
pub(crate) enum UnknownCTargetFeature {
UnknownFeaturePrefix { feature: String },
@ -8,7 +8,10 @@ pub(crate) enum UnknownCTargetFeature {
}
impl SessionDiagnostic<'_, ()> for UnknownCTargetFeature {
fn into_diagnostic(self, sess: &'_ rustc_session::parse::ParseSess) -> DiagnosticBuilder<'_, ()> {
fn into_diagnostic(
self,
sess: &'_ rustc_session::parse::ParseSess,
) -> DiagnosticBuilder<'_, ()> {
match self {
UnknownCTargetFeature::UnknownFeaturePrefix { feature } => {
let mut diag = sess.struct_warn(fluent::codegen_llvm::unknown_ctarget_feature);
@ -30,4 +33,4 @@ impl SessionDiagnostic<'_, ()> for UnknownCTargetFeature {
}
}
}
}
}

View File

@ -1,6 +1,6 @@
use crate::back::write::create_informational_target_machine;
use crate::llvm;
use crate::errors::UnknownCTargetFeature;
use crate::llvm;
use libc::c_int;
use rustc_codegen_ssa::target_features::{
supported_target_features, tied_target_features, RUSTC_SPECIFIC_FEATURES,
@ -435,7 +435,9 @@ pub(crate) fn global_llvm_features(sess: &Session, diagnostics: bool) -> Vec<Str
Some(c @ '+' | c @ '-') => c,
Some(_) => {
if diagnostics {
sess.emit_warning(UnknownCTargetFeature::UnknownFeaturePrefix { feature: s.to_string() });
sess.emit_warning(UnknownCTargetFeature::UnknownFeaturePrefix {
feature: s.to_string(),
});
}
return None;
}
@ -452,7 +454,10 @@ pub(crate) fn global_llvm_features(sess: &Session, diagnostics: bool) -> Vec<Str
None
}
});
sess.emit_warning(UnknownCTargetFeature::UnknownFeature { feature: feature.to_string(), rust_feature: rust_feature.map(|f| f.to_string()) });
sess.emit_warning(UnknownCTargetFeature::UnknownFeature {
feature: feature.to_string(),
rust_feature: rust_feature.map(|f| f.to_string()),
});
}
if diagnostics {