From 11f4968bd7372ed3986ff7d83fb14218ef0f2f20 Mon Sep 17 00:00:00 2001 From: "Felix S. Klock II" Date: Fri, 2 Jun 2017 12:52:09 +0200 Subject: [PATCH] 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. --- src/librustc_borrowck/borrowck/mir/elaborate_drops.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/librustc_borrowck/borrowck/mir/elaborate_drops.rs b/src/librustc_borrowck/borrowck/mir/elaborate_drops.rs index 7acfc2c3bbaf..833697726089 100644 --- a/src/librustc_borrowck/borrowck/mir/elaborate_drops.rs +++ b/src/librustc_borrowck/borrowck/mir/elaborate_drops.rs @@ -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)); }