From 735435bf964dcafdfc09d01ea644bbfbe725abd8 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Thu, 21 Apr 2011 16:44:17 -0700 Subject: stdlib: Add a pointer equality function to the standard library and a test case --- src/lib/Box.rs | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 src/lib/Box.rs (limited to 'src/lib/Box.rs') diff --git a/src/lib/Box.rs b/src/lib/Box.rs new file mode 100644 index 00000000..2d94c680 --- /dev/null +++ b/src/lib/Box.rs @@ -0,0 +1,8 @@ +export rustrt; + +native "rust" mod rustrt { + fn rust_ptr_eq[T](@T a, @T b) -> int; +} + +fn ptr_eq[T](@T a, @T b) -> bool { ret rustrt.rust_ptr_eq[T](a, b) != 0; } + -- cgit v1.2.3