diff --git a/src/libcore/ptr.rs b/src/libcore/ptr.rs index 6270e5892b3a0..6ed168b3f1761 100644 --- a/src/libcore/ptr.rs +++ b/src/libcore/ptr.rs @@ -2105,7 +2105,8 @@ impl Eq for *mut T {} #[stable(feature = "ptr_eq", since = "1.17.0")] #[inline] pub fn eq(a: *const T, b: *const T) -> bool { - a == b + // cast to thin pointers to ignore the vtable part + a as *const () == b as *const () } // Impls for function pointers