diff options
| author | xales <xales@naveria.com> | 2014-01-28 21:05:57 -0500 |
|---|---|---|
| committer | xales <xales@naveria.com> | 2014-01-29 20:31:03 -0500 |
| commit | f17d972014625eae13ac6d7fe98ff82a110a14d3 (patch) | |
| tree | a540265f6339b1b9197bbb44f940ac37ca88ac7e /src/libstd | |
| parent | d547f7ac216966240d90dd9b24fe2797dbec09e2 (diff) | |
| download | rust-f17d972014625eae13ac6d7fe98ff82a110a14d3.tar.gz rust-f17d972014625eae13ac6d7fe98ff82a110a14d3.zip | |
Remove seldom-used std::reference functions.
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/lib.rs | 2 | ||||
| -rw-r--r-- | src/libstd/reference.rs | 25 | ||||
| -rw-r--r-- | src/libstd/rt/task.rs | 3 |
3 files changed, 2 insertions, 28 deletions
diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index b9ecf890458..d7a7011319a 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -123,7 +123,7 @@ pub mod send_str; pub mod ptr; pub mod owned; pub mod managed; -pub mod reference; +mod reference; pub mod rc; pub mod gc; diff --git a/src/libstd/reference.rs b/src/libstd/reference.rs index 66df4334adc..91f03f02892 100644 --- a/src/libstd/reference.rs +++ b/src/libstd/reference.rs @@ -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)); - } -} diff --git a/src/libstd/rt/task.rs b/src/libstd/rt/task.rs index 09b91c138bc..7c43e64f17b 100644 --- a/src/libstd/rt/task.rs +++ b/src/libstd/rt/task.rs @@ -14,7 +14,6 @@ //! to implement this. use any::AnyOwnExt; -use reference; use cast; use cleanup; use clone::Clone; @@ -287,7 +286,7 @@ impl Task { impl Drop for Task { fn drop(&mut self) { - rtdebug!("called drop for a task: {}", reference::to_uint(self)); + rtdebug!("called drop for a task: {}", self as *mut Task as uint); rtassert!(self.destroyed); } } |
