Skip to content

Commit 2626cfb

Browse files
Allow Unreachable terminators behind const_if_match
1 parent 797fd92 commit 2626cfb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/librustc_mir/transform/qualify_min_const_fn.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,9 @@ fn check_terminator(
337337
check_operand(tcx, discr, span, def_id, body)
338338
}
339339

340+
// FIXME(ecstaticmorse): We probably want to allow `Unreachable` unconditionally.
341+
TerminatorKind::Unreachable if tcx.features().const_if_match => Ok(()),
342+
340343
| TerminatorKind::Abort | TerminatorKind::Unreachable => {
341344
Err((span, "const fn with unreachable code is not stable".into()))
342345
}

0 commit comments

Comments
 (0)