Skip to content

Commit 06dbaec

Browse files
Only emit drop for remaining variants if they have fields.
1 parent 5e8897b commit 06dbaec

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/librustc_mir/util/elaborate_drops.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ where
472472
}
473473
let (normal, _) = self.drop_ladder(fields, succ, unwind);
474474
normal_blocks.push(normal);
475-
} else {
475+
} else if !adt.variants[variant_index].fields.is_empty() {
476476
have_otherwise = true;
477477
}
478478
}

0 commit comments

Comments
 (0)