From e615f671cefc4d2b934ddb0d151b55f311d793ec Mon Sep 17 00:00:00 2001 From: Scott Olson Date: Fri, 16 Dec 2016 00:06:03 -0800 Subject: [PATCH] Remove potentially wrong PartialEq from PrimVal. --- src/terminator/mod.rs | 2 +- src/value.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/terminator/mod.rs b/src/terminator/mod.rs index 06c006baeed7..72e64c6a6fd9 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 943f096c7ed8..ae42cb9bfd32 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),