about summary refs log tree commit diff
path: root/src/librustc_trans/mir/rvalue.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/librustc_trans/mir/rvalue.rs')
-rw-r--r--src/librustc_trans/mir/rvalue.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/librustc_trans/mir/rvalue.rs b/src/librustc_trans/mir/rvalue.rs
index b931d9a2549..b7143f23691 100644
--- a/src/librustc_trans/mir/rvalue.rs
+++ b/src/librustc_trans/mir/rvalue.rs
@@ -277,8 +277,8 @@ impl<'a, 'tcx> MirContext<'a, 'tcx> {
                         let llval = operand.immediate();
                         let l = bcx.ccx.layout_of(operand.ty);
 
-                        if let Layout::CEnum { min, max, .. } = *l {
-                            if max > min {
+                        if let Layout::General { ref discr_range, .. } = *l {
+                            if discr_range.end > discr_range.start {
                                 // We want `table[e as usize]` to not
                                 // have bound checks, and this is the most
                                 // convenient place to put the `assume`.
@@ -286,7 +286,7 @@ impl<'a, 'tcx> MirContext<'a, 'tcx> {
                                 base::call_assume(&bcx, bcx.icmp(
                                     llvm::IntULE,
                                     llval,
-                                    C_uint(ll_t_in, max)
+                                    C_uint(ll_t_in, discr_range.end)
                                 ));
                             }
                         }