#[doc = "Operations on shared box types"]; export ptr_eq; pure fn ptr_eq(a: @T, b: @T) -> bool { #[doc = "Determine if two shared boxes point to the same object"]; unsafe { ptr::addr_of(*a) == ptr::addr_of(*b) } } #[test] fn test() { let x = @3; let y = @3; assert (ptr_eq::(x, x)); assert (ptr_eq::(y, y)); assert (!ptr_eq::(x, y)); assert (!ptr_eq::(y, x)); }