mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 23:04:33 +00:00
Rollup merge of #80464 - LingMan:map_or, r=oli-obk
Use Option::map_or instead of open coding it ``@rustbot`` modify labels +C-cleanup +T-compiler
This commit is contained in:
commit
30ddc91d41
@ -397,10 +397,8 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
|
|||||||
match i.kind {
|
match i.kind {
|
||||||
ast::ForeignItemKind::Fn(..) | ast::ForeignItemKind::Static(..) => {
|
ast::ForeignItemKind::Fn(..) | ast::ForeignItemKind::Static(..) => {
|
||||||
let link_name = self.sess.first_attr_value_str_by_name(&i.attrs, sym::link_name);
|
let link_name = self.sess.first_attr_value_str_by_name(&i.attrs, sym::link_name);
|
||||||
let links_to_llvm = match link_name {
|
let links_to_llvm =
|
||||||
Some(val) => val.as_str().starts_with("llvm."),
|
link_name.map_or(false, |val| val.as_str().starts_with("llvm."));
|
||||||
_ => false,
|
|
||||||
};
|
|
||||||
if links_to_llvm {
|
if links_to_llvm {
|
||||||
gate_feature_post!(
|
gate_feature_post!(
|
||||||
&self,
|
&self,
|
||||||
|
Loading…
Reference in New Issue
Block a user