Skip to content

Commit 386614b

Browse files
committed
refactor: cleaner check to return None
1 parent 66701c4 commit 386614b

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

compiler/rustc_codegen_llvm/src/llvm_util.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -698,13 +698,10 @@ fn backend_feature_name<'a>(sess: &Session, s: &'a str) -> Option<&'a str> {
698698
let feature = s
699699
.strip_prefix(&['+', '-'][..])
700700
.unwrap_or_else(|| sess.dcx().emit_fatal(InvalidTargetFeaturePrefix { feature: s }));
701-
if s.is_empty() {
702-
return None;
703-
}
704701
// Rustc-specific feature requests like `+crt-static` or `-crt-static`
705702
// are not passed down to LLVM.
706-
if RUSTC_SPECIFIC_FEATURES.contains(&feature) {
707-
return None;
703+
if s.is_empty() | RUSTC_SPECIFIC_FEATURES.contains(&feature) {
704+
None
708705
}
709706
Some(feature)
710707
}

0 commit comments

Comments
 (0)