Skip to content

Commit 52be0b0

Browse files
committed
Only check min_const_fn for const fns
1 parent f1bacb2 commit 52be0b0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librustc_mir/transform/check_consts/validation.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ impl Validator<'a, 'mir, 'tcx> {
201201
let Item { tcx, body, def_id, const_kind, .. } = *self.item;
202202

203203
let use_min_const_fn_checks =
204-
tcx.is_min_const_fn(def_id)
204+
(const_kind == Some(ConstKind::ConstFn) && tcx.is_min_const_fn(def_id))
205205
&& !tcx.sess.opts.debugging_opts.unleash_the_miri_inside_of_you;
206206

207207
if use_min_const_fn_checks {

0 commit comments

Comments
 (0)