mirror of
https://github.com/rust-lang/rust.git
synced 2026-06-01 14:10:03 +03:00
14 lines
321 B
Rust
14 lines
321 B
Rust
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;
|
|
}
|
|
}
|