From c78a00991b57bdeec0f55452d14b9e4a0ccc97c4 Mon Sep 17 00:00:00 2001 From: Niko Matsakis Date: Thu, 19 Sep 2019 13:42:46 -0400 Subject: [PATCH] whoops, only trigger this path for avoiding DROP, not StorageDead --- src/librustc_mir/build/scope.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/librustc_mir/build/scope.rs b/src/librustc_mir/build/scope.rs index 13d94262b6c53..a26ec72584bda 100644 --- a/src/librustc_mir/build/scope.rs +++ b/src/librustc_mir/build/scope.rs @@ -1123,16 +1123,16 @@ fn build_scope_drops<'tcx>( let source_info = scope.source_info(drop_data.span); let local = drop_data.local; - // If the operand has been moved, and we are not on an unwind - // path, then don't generate the drop. (We only take this into - // account for non-unwind paths so as not to disturb the - // caching mechanism.) - if !is_cached_path && scope.moved_locals.iter().any(|&o| o == local) { - continue; - } - match drop_data.kind { DropKind::Value => { + // If the operand has been moved, and we are not on an unwind + // path, then don't generate the drop. (We only take this into + // account for non-unwind paths so as not to disturb the + // caching mechanism.) + if !is_cached_path && scope.moved_locals.iter().any(|&o| o == local) { + continue; + } + let unwind_to = get_unwind_to(scope, is_generator, drop_idx, generator_drop) .unwrap_or(last_unwind_to);