We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 7c57d51 + 3dae414 commit 30ddc91Copy full SHA for 30ddc91
compiler/rustc_ast_passes/src/feature_gate.rs
@@ -397,10 +397,8 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
397
match i.kind {
398
ast::ForeignItemKind::Fn(..) | ast::ForeignItemKind::Static(..) => {
399
let link_name = self.sess.first_attr_value_str_by_name(&i.attrs, sym::link_name);
400
- let links_to_llvm = match link_name {
401
- Some(val) => val.as_str().starts_with("llvm."),
402
- _ => false,
403
- };
+ let links_to_llvm =
+ link_name.map_or(false, |val| val.as_str().starts_with("llvm."));
404
if links_to_llvm {
405
gate_feature_post!(
406
&self,
0 commit comments