Skip to content

Commit c78a009

Browse files
committed
whoops, only trigger this path for avoiding DROP, not StorageDead
1 parent 2655663 commit c78a009

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/librustc_mir/build/scope.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -1123,16 +1123,16 @@ fn build_scope_drops<'tcx>(
11231123
let source_info = scope.source_info(drop_data.span);
11241124
let local = drop_data.local;
11251125

1126-
// If the operand has been moved, and we are not on an unwind
1127-
// path, then don't generate the drop. (We only take this into
1128-
// account for non-unwind paths so as not to disturb the
1129-
// caching mechanism.)
1130-
if !is_cached_path && scope.moved_locals.iter().any(|&o| o == local) {
1131-
continue;
1132-
}
1133-
11341126
match drop_data.kind {
11351127
DropKind::Value => {
1128+
// If the operand has been moved, and we are not on an unwind
1129+
// path, then don't generate the drop. (We only take this into
1130+
// account for non-unwind paths so as not to disturb the
1131+
// caching mechanism.)
1132+
if !is_cached_path && scope.moved_locals.iter().any(|&o| o == local) {
1133+
continue;
1134+
}
1135+
11361136
let unwind_to = get_unwind_to(scope, is_generator, drop_idx, generator_drop)
11371137
.unwrap_or(last_unwind_to);
11381138

0 commit comments

Comments
 (0)