Skip to content

Commit

Permalink
make std::managed private
Browse files Browse the repository at this point in the history
This removes two tests built on `managed::refcount`, but these issues
are well-covered elsewhere for non-managed types.
  • Loading branch information
thestinger committed Mar 23, 2014
1 parent 7e7a5e3 commit 31d5ffc
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 87 deletions.
2 changes: 1 addition & 1 deletion src/libstd/lib.rs
Expand Up @@ -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;
Expand Down
18 changes: 0 additions & 18 deletions src/libstd/managed.rs
Expand Up @@ -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 {
Expand Down Expand Up @@ -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);
}
44 changes: 0 additions & 44 deletions src/test/run-pass/match-pattern-drop.rs

This file was deleted.

24 changes: 0 additions & 24 deletions src/test/run-pass/unique-copy-box.rs

This file was deleted.

5 comments on commit 31d5ffc

@bors
Copy link
Contributor

@bors bors commented on 31d5ffc Mar 23, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 31d5ffc Mar 23, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging thestinger/rust/managed = 31d5ffc into auto

@bors
Copy link
Contributor

@bors bors commented on 31d5ffc Mar 23, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thestinger/rust/managed = 31d5ffc merged ok, testing candidate = 3d9fdf7

@bors
Copy link
Contributor

@bors bors commented on 31d5ffc Mar 23, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bors
Copy link
Contributor

@bors bors commented on 31d5ffc Mar 23, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 3d9fdf7

Please sign in to comment.