Remove seldom-used std::reference functions.

This commit is contained in:
xales
2014-01-28 21:05:57 -05:00
parent d547f7ac21
commit f17d972014
7 changed files with 8 additions and 39 deletions

View File

@@ -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));
}
}