Skip to content

Commit 45748a3

Browse files
committed
rustc: Implement ptr_eq in Rust. Shaves 4 s off compile time.
1 parent 355f77e commit 45748a3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/lib/box.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11

22
export ptr_eq;
33

4-
native "rust" mod rustrt {
5-
fn rust_ptr_eq[T](@T a, @T b) -> int;
4+
fn ptr_eq[T](&@T a, &@T b) -> bool {
5+
let uint a_ptr = unsafe::reinterpret_cast(a);
6+
let uint b_ptr = unsafe::reinterpret_cast(b);
7+
ret a_ptr == b_ptr;
68
}
7-
8-
fn ptr_eq[T](@T a, @T b) -> bool { ret rustrt::rust_ptr_eq[T](a, b) != 0; }

0 commit comments

Comments
 (0)