From ae5ea85c361e2b383b01c1101d731843795ea0cb Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Tue, 6 Mar 2012 19:15:31 -0800 Subject: [PATCH] core: Resolve a FIXME in box::ptr_eq --- src/libcore/box.rs | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) 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]