Skip to content

Commit 11f4968

Browse files
committed
Revised comment explaining my addition of case for TerminatorKind::Resume.
Also, I removed the `continue;` statement. I don't think it makes a difference whether its there or not, but having it there confuses things when the actual goal was to side-step the assertion in the default case.
1 parent 163d40d commit 11f4968

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/librustc_borrowck/borrowck/mir/elaborate_drops.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -585,11 +585,6 @@ impl<'b, 'tcx> ElaborateDropsCtxt<'b, 'tcx> {
585585
// drop elaboration should handle that by itself
586586
continue
587587
}
588-
TerminatorKind::Resume => {
589-
// We can replace resumes with gotos
590-
// jumping to a canonical resume.
591-
continue
592-
}
593588
TerminatorKind::DropAndReplace { .. } => {
594589
// this contains the move of the source and
595590
// the initialization of the destination. We
@@ -599,6 +594,11 @@ impl<'b, 'tcx> ElaborateDropsCtxt<'b, 'tcx> {
599594
assert!(self.patch.is_patched(bb));
600595
allow_initializations = false;
601596
}
597+
TerminatorKind::Resume => {
598+
// It is possible for `Resume` to be patched
599+
// (in particular it can be patched to be replaced with
600+
// a Goto; see `MirPatch::new`).
601+
}
602602
_ => {
603603
assert!(!self.patch.is_patched(bb));
604604
}

0 commit comments

Comments
 (0)