Skip to content

Commit

Permalink
Revised comment explaining my addition of case for `TerminatorKind::R…
Browse files Browse the repository at this point in the history
…esume`.

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.
  • Loading branch information
pnkfelix committed Jun 12, 2017
1 parent 163d40d commit 11f4968
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/librustc_borrowck/borrowck/mir/elaborate_drops.rs
Expand Up @@ -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
Expand All @@ -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));
}
Expand Down

0 comments on commit 11f4968

Please sign in to comment.