@@ -344,7 +344,8 @@ fn check_terminator(
344344 | TerminatorKind :: FalseUnwind { .. }
345345 | TerminatorKind :: Goto { .. }
346346 | TerminatorKind :: Return
347- | TerminatorKind :: Resume => Ok ( ( ) ) ,
347+ | TerminatorKind :: Resume
348+ | TerminatorKind :: Unreachable => Ok ( ( ) ) ,
348349
349350 TerminatorKind :: Drop { location, .. } => check_place ( tcx, * location, span, def_id, body) ,
350351 TerminatorKind :: DropAndReplace { location, value, .. } => {
@@ -360,12 +361,7 @@ fn check_terminator(
360361 check_operand ( tcx, discr, span, def_id, body)
361362 }
362363
363- // FIXME(ecstaticmorse): We probably want to allow `Unreachable` unconditionally.
364- TerminatorKind :: Unreachable if feature_allowed ( tcx, def_id, sym:: const_if_match) => Ok ( ( ) ) ,
365-
366- TerminatorKind :: Abort | TerminatorKind :: Unreachable => {
367- Err ( ( span, "const fn with unreachable code is not stable" . into ( ) ) )
368- }
364+ TerminatorKind :: Abort => Err ( ( span, "abort is not stable in const fn" . into ( ) ) ) ,
369365 TerminatorKind :: GeneratorDrop | TerminatorKind :: Yield { .. } => {
370366 Err ( ( span, "const fn generators are unstable" . into ( ) ) )
371367 }
0 commit comments