We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2987785 commit 3dae414Copy full SHA for 3dae414
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