diff --git a/src/terminator/mod.rs b/src/terminator/mod.rs index 06c006baeed..72e64c6a6fd 100644 --- a/src/terminator/mod.rs +++ b/src/terminator/mod.rs @@ -53,7 +53,7 @@ impl<'a, 'tcx> EvalContext<'a, 'tcx> { for (index, const_val) in values.iter().enumerate() { let val = self.const_to_value(const_val)?; let prim = self.value_to_primval(val, discr_ty)?; - if discr_prim == prim { + if discr_prim.bits() == prim.bits() { target_block = targets[index]; break; } diff --git a/src/value.rs b/src/value.rs index 943f096c7ed..ae42cb9bfd3 100644 --- a/src/value.rs +++ b/src/value.rs @@ -47,7 +47,7 @@ pub enum Value { /// `memory::Allocation`. It is in many ways like a small chunk of a `Allocation`, up to 8 bytes in /// size. Like a range of bytes in an `Allocation`, a `PrimVal` can either represent the raw bytes /// of a simple value, a pointer into another `Allocation`, or be undefined. -#[derive(Clone, Copy, Debug, PartialEq)] +#[derive(Clone, Copy, Debug)] pub enum PrimVal { /// The raw bytes of a simple value. Bytes(u64),