about summary refs log tree commit diff
path: root/src/libsync
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2014-03-04 13:16:41 -0800
committerbors <bors@rust-lang.org>2014-03-04 13:16:41 -0800
commit0a5138c75244ffc0bc639d3060566e8efc83748e (patch)
tree1d6f2aa69b5fac73270b2ed5d803ff2a06646ca2 /src/libsync
parenta15448c85a557a2b047e4ed94fb36000320cccb5 (diff)
parent3158047a459b6d60d0f8f6bf5c299db0910e029a (diff)
downloadrust-0a5138c75244ffc0bc639d3060566e8efc83748e.tar.gz
rust-0a5138c75244ffc0bc639d3060566e8efc83748e.zip
auto merge of #12667 : Kimundi/rust/any_improv, r=cmr
- Added `TraitObject` representation to `std::raw`.
- Added doc to `std::raw`.
- Removed `Any::as_void_ptr()` and `Any::as_mut_void_ptr()`
  methods as they are uneccessary now after the removal of
  headers on owned boxes. This reduces the number of virtual calls needed from 2 to 1.
- Made the `..Ext` implementations work directly with the repr of
  a trait object.
- Removed `Any`-related traits from the prelude.
- Added bench.

Bench before/after:
~~~
7 ns/iter (+/- 0)
4 ns/iter (+/- 0)
~~~
Diffstat (limited to 'src/libsync')
-rw-r--r--src/libsync/sync/mod.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libsync/sync/mod.rs b/src/libsync/sync/mod.rs
index 7078f01945e..9fe585c263f 100644
--- a/src/libsync/sync/mod.rs
+++ b/src/libsync/sync/mod.rs
@@ -976,6 +976,8 @@ mod tests {
     }
     #[test]
     fn test_mutex_killed_simple() {
+        use std::any::Any;
+
         // Mutex must get automatically unlocked if failed/killed within.
         let m = Mutex::new();
         let m2 = m.clone();
@@ -992,6 +994,8 @@ mod tests {
     #[ignore(reason = "linked failure")]
     #[test]
     fn test_mutex_killed_cond() {
+        use std::any::Any;
+
         // Getting killed during cond wait must not corrupt the mutex while
         // unwinding (e.g. double unlock).
         let m = Mutex::new();
@@ -1019,6 +1023,7 @@ mod tests {
     #[ignore(reason = "linked failure")]
     #[test]
     fn test_mutex_killed_broadcast() {
+        use std::any::Any;
         use std::unstable::finally::Finally;
 
         let m = Mutex::new();
@@ -1329,6 +1334,8 @@ mod tests {
     }
     #[cfg(test)]
     fn rwlock_kill_helper(mode1: RWLockMode, mode2: RWLockMode) {
+        use std::any::Any;
+
         // Mutex must get automatically unlocked if failed/killed within.
         let x = RWLock::new();
         let x2 = x.clone();