@@ -344,7 +344,8 @@ fn check_terminator(
344
344
| TerminatorKind :: FalseUnwind { .. }
345
345
| TerminatorKind :: Goto { .. }
346
346
| TerminatorKind :: Return
347
- | TerminatorKind :: Resume => Ok ( ( ) ) ,
347
+ | TerminatorKind :: Resume
348
+ | TerminatorKind :: Unreachable => Ok ( ( ) ) ,
348
349
349
350
TerminatorKind :: Drop { location, .. } => check_place ( tcx, * location, span, def_id, body) ,
350
351
TerminatorKind :: DropAndReplace { location, value, .. } => {
@@ -360,12 +361,7 @@ fn check_terminator(
360
361
check_operand ( tcx, discr, span, def_id, body)
361
362
}
362
363
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 ( ) ) ) ,
369
365
TerminatorKind :: GeneratorDrop | TerminatorKind :: Yield { .. } => {
370
366
Err ( ( span, "const fn generators are unstable" . into ( ) ) )
371
367
}
0 commit comments