Skip to content

Commit 3dc7e93

Browse files
committed
Generator assertions are unconditionally triggered
1 parent 47913ee commit 3dc7e93

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/librustc_mir/transform/const_prop.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -404,10 +404,12 @@ impl<'b, 'a, 'tcx> Visitor<'tcx> for ConstPropagator<'b, 'a, 'tcx> {
404404
);
405405
use rustc::mir::AssertMessage::*;
406406
match msg {
407-
GeneratorResumedAfterReturn =>
408-
lint.span_label(span, "generator resumed after completion"),
409-
GeneratorResumedAfterPanic =>
410-
lint.span_label(span, "generator resumed after panicking"),
407+
// Need proper const propagator for these
408+
GeneratorResumedAfterReturn |
409+
GeneratorResumedAfterPanic => {
410+
lint.cancel();
411+
return;
412+
},
411413
Math(ref err) => lint.span_label(span, err.description()),
412414
BoundsCheck { ref len, ref index } => {
413415
let len = self.eval_operand(len).expect("len must be const");

0 commit comments

Comments
 (0)