diff options
| author | Ralf Jung <post@ralfj.de> | 2020-06-21 18:22:30 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2020-06-21 18:22:30 +0200 |
| commit | 3bfd0c9f0725b8fb096ea38446b4dcc2a3f90980 (patch) | |
| tree | 219a687f01d1bef28ae44afcd82b648adaeffe1d /src/librustc_codegen_ssa/mir | |
| parent | 38bd83df88288f2f8d1fc2dd317189cac3825920 (diff) | |
| download | rust-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.rs | 2 |
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]); |
