Remove seldom-used std::reference functions.
This commit is contained in:
@@ -13,18 +13,6 @@
|
||||
#[cfg(not(test))]
|
||||
use prelude::*;
|
||||
|
||||
/// Cast a region pointer - &T - to a uint.
|
||||
#[inline]
|
||||
pub fn to_uint<T>(thing: &T) -> uint {
|
||||
thing as *T as uint
|
||||
}
|
||||
|
||||
/// Determine if two borrowed pointers point to the same thing.
|
||||
#[inline]
|
||||
pub fn ref_eq<'a, 'b, T>(thing: &'a T, other: &'b T) -> bool {
|
||||
(thing as *T) == (other as *T)
|
||||
}
|
||||
|
||||
// Equality for region pointers
|
||||
#[cfg(not(test))]
|
||||
impl<'a, T: Eq> Eq for &'a T {
|
||||
@@ -71,16 +59,3 @@ impl<'a, T: TotalEq> TotalEq for &'a T {
|
||||
fn equals(&self, other: & &'a T) -> bool { (**self).equals(*other) }
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::ref_eq;
|
||||
|
||||
#[test]
|
||||
fn test_ref_eq() {
|
||||
let x = 1;
|
||||
let y = 1;
|
||||
|
||||
assert!(ref_eq(&x, &x));
|
||||
assert!(!ref_eq(&x, &y));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user