core: Resolve a FIXME in box::ptr_eq
This commit is contained in:
parent
04e7bd6758
commit
ae5ea85c36
@ -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]
|
||||
|
Loading…
x
Reference in New Issue
Block a user