cleanup: _,
} => check_operand(tcx, mir, cond, span),
- | TerminatorKind::FalseUnwind { .. } => span_bug!(
- terminator.source_info.span,
- "min_const_fn encountered `{:#?}`",
- terminator
- ),
+ TerminatorKind::FalseUnwind { .. } => {
+ Err((span, "loops are not allowed in const fn".into()))
+ },
}
}
--- /dev/null
+error: loops are not allowed in const fn
+ --> $DIR/loop_ice.rs:2:5
+ |
+LL | loop {} //~ ERROR loops are not allowed in const fn
+ | ^^^^^^^
+
+error: aborting due to previous error
+