about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorDaniel Micay <danielmicay@gmail.com>2014-03-22 18:45:47 -0400
committerDaniel Micay <danielmicay@gmail.com>2014-03-22 22:33:16 -0400
commit31d5ffc5bde1d67356d1d0469fec34c6d06a32b5 (patch)
tree8a3b1e44b0e50bdac74970936d4e733805157566 /src/libstd
parent7e7a5e3d3eabe0ee46474b0eb701c159a45b490f (diff)
downloadrust-31d5ffc5bde1d67356d1d0469fec34c6d06a32b5.tar.gz
rust-31d5ffc5bde1d67356d1d0469fec34c6d06a32b5.zip
make std::managed private
This removes two tests built on `managed::refcount`, but these issues
are well-covered elsewhere for non-managed types.
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/lib.rs2
-rw-r--r--src/libstd/managed.rs18
2 files changed, 1 insertions, 19 deletions
diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs
index 7d734469b12..8a890d0293c 100644
--- a/src/libstd/lib.rs
+++ b/src/libstd/lib.rs
@@ -134,7 +134,7 @@ pub mod ascii;
 
 pub mod ptr;
 pub mod owned;
-pub mod managed;
+mod managed;
 mod reference;
 pub mod rc;
 pub mod gc;
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);
-}