]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_mir/src/borrow_check/type_check/mod.rs
Refactor how SwitchInt stores jump targets
[rust.git] / compiler / rustc_mir / src / borrow_check / type_check / mod.rs
index f8a8801595a412342618ca595ba6d284b7c0f830..4fc1c570e4602fbad802d6aa4556b777a4204603 100644 (file)
@@ -1777,7 +1777,7 @@ fn check_iscleanup(&mut self, body: &Body<'tcx>, block_data: &BasicBlockData<'tc
                 self.assert_iscleanup(body, block_data, target, is_cleanup)
             }
             TerminatorKind::SwitchInt { ref targets, .. } => {
-                for target in targets {
+                for target in targets.all_targets() {
                     self.assert_iscleanup(body, block_data, *target, is_cleanup);
                 }
             }