Explain how we get to skip checking for cleanup blocks in the visitor
This commit is contained in:
parent
06e674313b
commit
88e78aba82
1 changed files with 2 additions and 0 deletions
|
@ -273,6 +273,8 @@ pub fn remove_duplicate_unreachable_blocks<'tcx>(tcx: TyCtxt<'tcx>, body: &mut B
|
|||
|
||||
fn visit_terminator(&mut self, terminator: &mut Terminator<'tcx>, location: Location) {
|
||||
for target in terminator.successors_mut() {
|
||||
// We don't have to check whether `target` is a cleanup block, because have
|
||||
// entirely excluded cleanup blocks in building the set of duplicates.
|
||||
if self.duplicates.contains(target) {
|
||||
*target = self.duplicates[0];
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue