use option::{Option, Some, None};
use intrinsics;
-#[cfg(not(test))] use cmp::{Eq, Ord};
+#[cfg(not(test))] use cmp::{Eq, TotalEq, Ord};
/// Return the offset of the first null pointer in `buf`.
#[inline]
SAFETY NOTE: Pointer-arithmetic. Dragons be here.
*/
pub unsafe fn array_each_with_len<T>(arr: **T, len: uint, cb: |*T|) {
- debug!("array_each_with_len: before iterate");
if arr.is_null() {
fail!("ptr::array_each_with_len failure: arr input is null pointer");
}
let n = arr.offset(e as int);
cb(*n);
}
- debug!("array_each_with_len: after iterate");
}
/**
fail!("ptr::array_each_with_len failure: arr input is null pointer");
}
let len = buf_len(arr);
- debug!("array_each inferred len: {}", len);
array_each_with_len(arr, len, cb);
}
fn ne(&self, other: &*T) -> bool { !self.eq(other) }
}
+#[cfg(not(test))]
+impl<T> TotalEq for *T {}
+
#[cfg(not(test))]
impl<T> Eq for *mut T {
#[inline]
fn ne(&self, other: &*mut T) -> bool { !self.eq(other) }
}
+#[cfg(not(test))]
+impl<T> TotalEq for *mut T {}
+
// Equivalence for pointers
#[cfg(not(test))]
impl<T> Equiv<*mut T> for *T {
use cast;
use libc;
use str;
- use vec::{ImmutableVector, MutableVector};
+ use slice::{ImmutableVector, MutableVector};
#[test]
fn test() {