fn build_error(&self, ccx: &ConstCx<'_, 'tcx>, span: Span) -> DiagnosticBuilder<'tcx>;
}
-#[derive(Debug)]
-pub struct Abort;
-impl NonConstOp for Abort {
- fn status_in_item(&self, ccx: &ConstCx<'_, '_>) -> Status {
- mcf_status_in_item(ccx)
- }
-
- fn build_error(&self, ccx: &ConstCx<'_, 'tcx>, span: Span) -> DiagnosticBuilder<'tcx> {
- mcf_build_error(ccx, span, "abort is not stable in const fn")
- }
-}
-
#[derive(Debug)]
pub struct FloatingPointOp;
impl NonConstOp for FloatingPointOp {
}
TerminatorKind::InlineAsm { .. } => self.check_op(ops::InlineAsm),
- TerminatorKind::Abort => self.check_op(ops::Abort),
TerminatorKind::GeneratorDrop | TerminatorKind::Yield { .. } => {
self.check_op(ops::Generator(hir::GeneratorKind::Gen))
}
- TerminatorKind::Assert { .. }
+ TerminatorKind::Abort
+ | TerminatorKind::Assert { .. }
| TerminatorKind::FalseEdge { .. }
| TerminatorKind::FalseUnwind { .. }
| TerminatorKind::Goto { .. }