about summary refs log tree commit diff
path: root/src/librustc_codegen_ssa/mir
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2020-06-21 18:22:30 +0200
committerRalf Jung <post@ralfj.de>2020-06-21 18:22:30 +0200
commit3bfd0c9f0725b8fb096ea38446b4dcc2a3f90980 (patch)
tree219a687f01d1bef28ae44afcd82b648adaeffe1d /src/librustc_codegen_ssa/mir
parent38bd83df88288f2f8d1fc2dd317189cac3825920 (diff)
downloadrust-3bfd0c9f0725b8fb096ea38446b4dcc2a3f90980.tar.gz
rust-3bfd0c9f0725b8fb096ea38446b4dcc2a3f90980.zip
remove switch_ty reliance in codegen
Diffstat (limited to 'src/librustc_codegen_ssa/mir')
-rw-r--r--src/librustc_codegen_ssa/mir/block.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/librustc_codegen_ssa/mir/block.rs b/src/librustc_codegen_ssa/mir/block.rs
index d56c816811b..5125ce779ed 100644
--- a/src/librustc_codegen_ssa/mir/block.rs
+++ b/src/librustc_codegen_ssa/mir/block.rs
@@ -200,6 +200,8 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
         targets: &Vec<mir::BasicBlock>,
     ) {
         let discr = self.codegen_operand(&mut bx, &discr);
+        // `switch_ty` is redundant, sanity-check that.
+        assert_eq!(discr.layout.ty, switch_ty);
         if targets.len() == 2 {
             // If there are two targets, emit br instead of switch
             let lltrue = helper.llblock(self, targets[0]);