Skip to content

Commit a54c800

Browse files
committed
Formatting
1 parent 575f609 commit a54c800

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

compiler/rustc_codegen_llvm/src/errors.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1+
use rustc_errors::fluent;
12
use rustc_errors::DiagnosticBuilder;
23
use rustc_session::SessionDiagnostic;
3-
use rustc_errors::fluent;
44

55
pub(crate) enum UnknownCTargetFeature {
66
UnknownFeaturePrefix { feature: String },
77
UnknownFeature { feature: String, rust_feature: Option<String> },
88
}
99

1010
impl SessionDiagnostic<'_, ()> for UnknownCTargetFeature {
11-
fn into_diagnostic(self, sess: &'_ rustc_session::parse::ParseSess) -> DiagnosticBuilder<'_, ()> {
11+
fn into_diagnostic(
12+
self,
13+
sess: &'_ rustc_session::parse::ParseSess,
14+
) -> DiagnosticBuilder<'_, ()> {
1215
match self {
1316
UnknownCTargetFeature::UnknownFeaturePrefix { feature } => {
1417
let mut diag = sess.struct_warn(fluent::codegen_llvm::unknown_ctarget_feature);
@@ -30,4 +33,4 @@ impl SessionDiagnostic<'_, ()> for UnknownCTargetFeature {
3033
}
3134
}
3235
}
33-
}
36+
}

compiler/rustc_codegen_llvm/src/llvm_util.rs

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use crate::back::write::create_informational_target_machine;
2-
use crate::llvm;
32
use crate::errors::UnknownCTargetFeature;
3+
use crate::llvm;
44
use libc::c_int;
55
use rustc_codegen_ssa::target_features::{
66
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
435435
Some(c @ '+' | c @ '-') => c,
436436
Some(_) => {
437437
if diagnostics {
438-
sess.emit_warning(UnknownCTargetFeature::UnknownFeaturePrefix { feature: s.to_string() });
438+
sess.emit_warning(UnknownCTargetFeature::UnknownFeaturePrefix {
439+
feature: s.to_string(),
440+
});
439441
}
440442
return None;
441443
}
@@ -452,7 +454,10 @@ pub(crate) fn global_llvm_features(sess: &Session, diagnostics: bool) -> Vec<Str
452454
None
453455
}
454456
});
455-
sess.emit_warning(UnknownCTargetFeature::UnknownFeature { feature: feature.to_string(), rust_feature: rust_feature.map(|f| f.to_string()) });
457+
sess.emit_warning(UnknownCTargetFeature::UnknownFeature {
458+
feature: feature.to_string(),
459+
rust_feature: rust_feature.map(|f| f.to_string()),
460+
});
456461
}
457462

458463
if diagnostics {

0 commit comments

Comments
 (0)