Skip to content

Commit 119efbc

Browse files
Use is_const_fn_raw when unsafety checking
1 parent 3a7dfda commit 119efbc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/librustc_mir/transform/check_unsafety.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use rustc_span::symbol::{sym, Symbol};
1414

1515
use std::ops::Bound;
1616

17-
use crate::const_eval::{is_const_fn, is_min_const_fn};
17+
use crate::const_eval::is_min_const_fn;
1818
use crate::util;
1919

2020
pub struct UnsafetyChecker<'a, 'tcx> {
@@ -527,7 +527,7 @@ fn unsafety_check_result(tcx: TyCtxt<'_>, def_id: LocalDefId) -> UnsafetyCheckRe
527527
let (const_context, min_const_fn) = match tcx.hir().body_owner_kind(id) {
528528
hir::BodyOwnerKind::Closure => (false, false),
529529
hir::BodyOwnerKind::Fn => {
530-
(is_const_fn(tcx, def_id.to_def_id()), is_min_const_fn(tcx, def_id.to_def_id()))
530+
(tcx.is_const_fn_raw(def_id.to_def_id()), is_min_const_fn(tcx, def_id.to_def_id()))
531531
}
532532
hir::BodyOwnerKind::Const | hir::BodyOwnerKind::Static(_) => (true, false),
533533
};

0 commit comments

Comments
 (0)