about summary refs log tree commit diff
path: root/compiler/rustc_codegen_cranelift
diff options
context:
space:
mode:
authorJakob Degen <jakob.e.degen@gmail.com>2022-12-03 16:03:27 -0800
committerJakob Degen <jakob.e.degen@gmail.com>2022-12-09 04:53:10 -0800
commit9fb8da8f8ff1a0b2c237c691fee58b6348811b86 (patch)
tree8b3c32c7333890a7f54a1cab61a30a89c7c30d80 /compiler/rustc_codegen_cranelift
parent14ca83a04b00433a8caf3b805d5ea08cb2691e1b (diff)
downloadrust-9fb8da8f8ff1a0b2c237c691fee58b6348811b86.tar.gz
rust-9fb8da8f8ff1a0b2c237c691fee58b6348811b86.zip
Remove unneeded field from `SwitchTargets`
Diffstat (limited to 'compiler/rustc_codegen_cranelift')
-rw-r--r--compiler/rustc_codegen_cranelift/src/base.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_cranelift/src/base.rs b/compiler/rustc_codegen_cranelift/src/base.rs
index 1db44502742..06813d7ec95 100644
--- a/compiler/rustc_codegen_cranelift/src/base.rs
+++ b/compiler/rustc_codegen_cranelift/src/base.rs
@@ -372,8 +372,10 @@ fn codegen_fn_body(fx: &mut FunctionCx<'_, '_, '_>, start_block: Block) {
                 }
             }
 
-            TerminatorKind::SwitchInt { discr, switch_ty, targets } => {
-                let discr = codegen_operand(fx, discr).load_scalar(fx);
+            TerminatorKind::SwitchInt { discr, targets } => {
+                let discr = codegen_operand(fx, discr);
+                let switch_ty = discr.layout().ty;
+                let discr = discr.load_scalar(fx);
 
                 let use_bool_opt = switch_ty.kind() == fx.tcx.types.bool.kind()
                     || (targets.iter().count() == 1 && targets.iter().next().unwrap().0 == 0);