mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-04 11:04:03 +00:00
rustc: Implement ptr_eq in Rust. Shaves 4 s off compile time.
This commit is contained in:
parent
355f77ef87
commit
45748a3be4
@ -1,8 +1,8 @@
|
|||||||
|
|
||||||
export ptr_eq;
|
export ptr_eq;
|
||||||
|
|
||||||
native "rust" mod rustrt {
|
fn ptr_eq[T](&@T a, &@T b) -> bool {
|
||||||
fn rust_ptr_eq[T](@T a, @T b) -> int;
|
let uint a_ptr = unsafe::reinterpret_cast(a);
|
||||||
|
let uint b_ptr = unsafe::reinterpret_cast(b);
|
||||||
|
ret a_ptr == b_ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
fn ptr_eq[T](@T a, @T b) -> bool { ret rustrt::rust_ptr_eq[T](a, b) != 0; }
|
|
Loading…
Reference in New Issue
Block a user