@@ -245,16 +245,10 @@ impl Validator<'a, 'mir, 'tcx> {
245245
246246 check_short_circuiting_in_const_local ( self . item ) ;
247247
248- // FIXME: give a span for the loop
249248 if body. is_cfg_cyclic ( ) {
250- // FIXME: make this the `emit_error` impl of `ops::Loop` once the const
251- // checker is no longer run in compatability mode.
252- if !self . tcx . sess . opts . debugging_opts . unleash_the_miri_inside_of_you {
253- self . tcx . sess . delay_span_bug (
254- self . span ,
255- "complex control flow is forbidden in a const context" ,
256- ) ;
257- }
249+ // We can't provide a good span for the error here, but this should be caught by the
250+ // HIR const-checker anyways.
251+ self . check_op_spanned ( ops:: Loop , body. span ) ;
258252 }
259253
260254 self . visit_body ( body) ;
@@ -565,14 +559,7 @@ impl Visitor<'tcx> for Validator<'_, 'mir, 'tcx> {
565559 self . super_statement ( statement, location) ;
566560 }
567561 StatementKind :: FakeRead ( FakeReadCause :: ForMatchedPlace , _) => {
568- // FIXME: make this the `emit_error` impl of `ops::IfOrMatch` once the const
569- // checker is no longer run in compatability mode.
570- if !self . tcx . sess . opts . debugging_opts . unleash_the_miri_inside_of_you {
571- self . tcx . sess . delay_span_bug (
572- self . span ,
573- "complex control flow is forbidden in a const context" ,
574- ) ;
575- }
562+ self . check_op ( ops:: IfOrMatch ) ;
576563 }
577564 // FIXME(eddyb) should these really do nothing?
578565 StatementKind :: FakeRead ( ..) |
0 commit comments