Skip to content

Commit faa52d1

Browse files
Correctly mark things as min_const_fn
1 parent 0f0bfc9 commit faa52d1

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/librustc_mir/transform/qualify_min_const_fn.rs

+6-4
Original file line numberDiff line numberDiff line change
@@ -390,10 +390,12 @@ fn check_terminator(
390390
cleanup: _,
391391
} => check_operand(tcx, cond, span, def_id, body),
392392

393-
TerminatorKind::FalseUnwind { .. } if !tcx.features().const_loop => {
394-
Err((span, "loops are not allowed in const fn".into()))
395-
},
393+
| TerminatorKind::FalseUnwind { .. }
394+
if feature_allowed(tcx, def_id, sym::const_loop)
395+
=> Ok(()),
396396

397-
TerminatorKind::FalseUnwind { .. } => Ok(()),
397+
TerminatorKind::FalseUnwind { .. } => {
398+
Err((span, "loops are not allowed in const fn".into()))
399+
}
398400
}
399401
}

0 commit comments

Comments
 (0)