core: Resolve a FIXME in box::ptr_eq

This commit is contained in:
Brian Anderson 2012-03-06 19:15:31 -08:00
parent 04e7bd6758
commit ae5ea85c36

View File

@ -3,13 +3,8 @@ export ptr_eq;
#[doc(
brief = "Determine if two shared boxes point to the same object"
)]
pure fn ptr_eq<T>(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<T>(a: @T, b: @T) -> bool unchecked {
ptr::addr_of(*a) == ptr::addr_of(*b)
}
#[test]