diff --git a/src/libcore/box.rs b/src/libcore/box.rs index 114c495d64d..dc96aebcebc 100644 --- a/src/libcore/box.rs +++ b/src/libcore/box.rs @@ -3,13 +3,8 @@ export ptr_eq; #[doc( brief = "Determine if two shared boxes point to the same object" )] -pure fn ptr_eq(a: @T, b: @T) -> bool { - // FIXME: ptr::addr_of - unsafe { - let a_ptr: uint = unsafe::reinterpret_cast(a); - let b_ptr: uint = unsafe::reinterpret_cast(b); - ret a_ptr == b_ptr; - } +pure fn ptr_eq(a: @T, b: @T) -> bool unchecked { + ptr::addr_of(*a) == ptr::addr_of(*b) } #[test]