Skip to content

Commit 9a25ea7

Browse files
committed
refactor: cleaner check to return None
1 parent 66701c4 commit 9a25ea7

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

compiler/rustc_codegen_llvm/src/llvm_util.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -698,12 +698,9 @@ 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) {
703+
if s.is_empty() | RUSTC_SPECIFIC_FEATURES.contains(&feature) {
707704
return None;
708705
}
709706
Some(feature)

0 commit comments

Comments
 (0)