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.
This commit is contained in:
Felix S. Klock II 2017-06-02 12:52:09 +02:00
parent 163d40d1d8
commit 11f4968bd7
1 changed files with 5 additions and 5 deletions

View File

@ -585,11 +585,6 @@ impl<'b, 'tcx> ElaborateDropsCtxt<'b, 'tcx> {
// drop elaboration should handle that by itself
continue
}
TerminatorKind::Resume => {
// We can replace resumes with gotos
// jumping to a canonical resume.
continue
}
TerminatorKind::DropAndReplace { .. } => {
// this contains the move of the source and
// the initialization of the destination. We
@ -599,6 +594,11 @@ impl<'b, 'tcx> ElaborateDropsCtxt<'b, 'tcx> {
assert!(self.patch.is_patched(bb));
allow_initializations = false;
}
TerminatorKind::Resume => {
// It is possible for `Resume` to be patched
// (in particular it can be patched to be replaced with
// a Goto; see `MirPatch::new`).
}
_ => {
assert!(!self.patch.is_patched(bb));
}