diff options
| author | bors <bors@rust-lang.org> | 2014-01-30 13:36:41 -0800 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-01-30 13:36:41 -0800 |
| commit | b3003e1e1af8ee5ca74458787f5eb8c565a47e1d (patch) | |
| tree | 468dce881317bb3d9521d94ffeb098ac4e9fbaad /src/libstd | |
| parent | 3427137f667e7def78f12a69af7d8beb2fcd5e65 (diff) | |
| parent | f17d972014625eae13ac6d7fe98ff82a110a14d3 (diff) | |
| download | rust-b3003e1e1af8ee5ca74458787f5eb8c565a47e1d.tar.gz rust-b3003e1e1af8ee5ca74458787f5eb8c565a47e1d.zip | |
auto merge of #11895 : xales/rust/libstd, r=alexcrichton
Fixes #11814
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/lib.rs | 3 | ||||
| -rw-r--r-- | src/libstd/reference.rs (renamed from src/libstd/borrow.rs) | 25 | ||||
| -rw-r--r-- | src/libstd/rt/task.rs | 3 |
3 files changed, 2 insertions, 29 deletions
diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 17b6c24773a..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 borrow; +mod reference; pub mod rc; pub mod gc; @@ -223,7 +223,6 @@ mod std { pub use kinds; pub use local_data; pub use logging; - pub use logging; pub use option; pub use os; pub use rt; diff --git a/src/libstd/borrow.rs b/src/libstd/reference.rs index 66df4334adc..91f03f02892 100644 --- a/src/libstd/borrow.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 e99e7fa4edd..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 borrow; 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: {}", borrow::to_uint(self)); + rtdebug!("called drop for a task: {}", self as *mut Task as uint); rtassert!(self.destroyed); } } |
