]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_mir_transform/src/const_goto.rs
Remove ineffective run of SimplifyConstCondition
[rust.git] / compiler / rustc_mir_transform / src / const_goto.rs
index 0a305a402095d758aecbe4ca5287f357f3c1a61e..40eefda4f076326002a270044b1526f9988110c3 100644 (file)
@@ -82,8 +82,9 @@ fn visit_terminator(&mut self, terminator: &Terminator<'tcx>, location: Location
                 }
 
                 let target_bb_terminator = target_bb.terminator();
-                let (discr, switch_ty, targets) = target_bb_terminator.kind.as_switch()?;
+                let (discr, targets) = target_bb_terminator.kind.as_switch()?;
                 if discr.place() == Some(*place) {
+                    let switch_ty = place.ty(self.body.local_decls(), self.tcx).ty;
                     // We now know that the Switch matches on the const place, and it is statementless
                     // Now find which value in the Switch matches the const value.
                     let const_value =