mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-25 22:22:44 +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;
|
||||
|
||||
native "rust" mod rustrt {
|
||||
fn rust_ptr_eq[T](@T a, @T b) -> int;
|
||||
fn ptr_eq[T](&@T a, &@T b) -> bool {
|
||||
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