Skip to content

Commit 7adb20e

Browse files
committed
Use is_const()
1 parent e688352 commit 7adb20e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/librustc/middle/reachable.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ fn item_might_be_inlined(tcx: TyCtxt<'tcx>, item: &hir::Item, attrs: CodegenFnAt
3333
}
3434

3535
match item.node {
36-
hir::ItemKind::Fn(_, header, ..) if header.constness == hir::Constness::Const => {
36+
hir::ItemKind::Fn(_, header, ..) if header.is_const() => {
3737
return true;
3838
}
3939
hir::ItemKind::Impl(..) |
@@ -56,7 +56,7 @@ fn method_might_be_inlined(
5656
return true
5757
}
5858
if let hir::ImplItemKind::Method(method_sig, _) = &impl_item.node {
59-
if method_sig.header.constness == hir::Constness::Const {
59+
if method_sig.header.is_const() {
6060
return true
6161
}
6262
}

0 commit comments

Comments
 (0)