Skip to content

Commit 88e78ab

Browse files
committed
Explain how we get to skip checking for cleanup blocks in the visitor
1 parent 06e6743 commit 88e78ab

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

compiler/rustc_mir_transform/src/simplify.rs

+2
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,8 @@ pub fn remove_duplicate_unreachable_blocks<'tcx>(tcx: TyCtxt<'tcx>, body: &mut B
273273

274274
fn visit_terminator(&mut self, terminator: &mut Terminator<'tcx>, location: Location) {
275275
for target in terminator.successors_mut() {
276+
// We don't have to check whether `target` is a cleanup block, because have
277+
// entirely excluded cleanup blocks in building the set of duplicates.
276278
if self.duplicates.contains(target) {
277279
*target = self.duplicates[0];
278280
}

0 commit comments

Comments
 (0)