Skip to content

Commit

Permalink
Use is_const()
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTitor committed Aug 15, 2019
1 parent e688352 commit 7adb20e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/librustc/middle/reachable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ fn item_might_be_inlined(tcx: TyCtxt<'tcx>, item: &hir::Item, attrs: CodegenFnAt
}

match item.node {
hir::ItemKind::Fn(_, header, ..) if header.constness == hir::Constness::Const => {
hir::ItemKind::Fn(_, header, ..) if header.is_const() => {
return true;
}
hir::ItemKind::Impl(..) |
Expand All @@ -56,7 +56,7 @@ fn method_might_be_inlined(
return true
}
if let hir::ImplItemKind::Method(method_sig, _) = &impl_item.node {
if method_sig.header.constness == hir::Constness::Const {
if method_sig.header.is_const() {
return true
}
}
Expand Down

0 comments on commit 7adb20e

Please sign in to comment.