diff options
Diffstat (limited to 'src/libstd/managed.rs')
| -rw-r--r-- | src/libstd/managed.rs | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/src/libstd/managed.rs b/src/libstd/managed.rs index 4cd99492ee4..141ed7a9206 100644 --- a/src/libstd/managed.rs +++ b/src/libstd/managed.rs @@ -12,13 +12,6 @@ #[cfg(not(test))] use cmp::*; -/// Returns the refcount of a shared box (as just before calling this) -#[inline] -pub fn refcount<T>(t: @T) -> uint { - use raw::Repr; - unsafe { (*t.repr()).ref_count - 1 } -} - /// Determine if two shared boxes point to the same object #[inline] pub fn ptr_eq<T>(a: @T, b: @T) -> bool { @@ -66,14 +59,3 @@ fn test() { assert!((!ptr_eq::<int>(x, y))); assert!((!ptr_eq::<int>(y, x))); } - -#[test] -fn refcount_test() { - use clone::Clone; - - let x = @3; - assert_eq!(refcount(x), 1); - let y = x.clone(); - assert_eq!(refcount(x), 2); - assert_eq!(refcount(y), 2); -} |
