diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-05-19 17:51:50 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-05-19 18:12:18 -0700 |
| commit | 4c8a4d241a984fdc0b8a015dceca2a006f2b7146 (patch) | |
| tree | 7772fcd323bf89dc475f9c9edb432bdf1fecc092 /src/libstd/sync/spsc_queue.rs | |
| parent | 73729e94c87281dd7193dbdc86b4de2963b8fd72 (diff) | |
| download | rust-4c8a4d241a984fdc0b8a015dceca2a006f2b7146.tar.gz rust-4c8a4d241a984fdc0b8a015dceca2a006f2b7146.zip | |
std: Remove UnsafeArc
This type has been superseded by Arc<Unsafe<T>>. The UnsafeArc type is a relic of an era that has long since past, and with the introduction of liballoc the standard library is able to use the Arc smart pointer. With little need left for UnsafeArc, it was removed. All existing code using UnsafeArc should either be reevaluated to whether it can use only Arc, or it should transition to Arc<Unsafe<T>> [breaking-change]
Diffstat (limited to 'src/libstd/sync/spsc_queue.rs')
| -rw-r--r-- | src/libstd/sync/spsc_queue.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/libstd/sync/spsc_queue.rs b/src/libstd/sync/spsc_queue.rs index 093933c82fc..fb515c9db6e 100644 --- a/src/libstd/sync/spsc_queue.rs +++ b/src/libstd/sync/spsc_queue.rs @@ -235,7 +235,7 @@ mod test { #[test] fn smoke() { - let mut q = Queue::new(0); + let q = Queue::new(0); q.push(1); q.push(2); assert_eq!(q.pop(), Some(1)); @@ -250,14 +250,14 @@ mod test { #[test] fn drop_full() { - let mut q = Queue::new(0); + let q = Queue::new(0); q.push(box 1); q.push(box 2); } #[test] fn smoke_bound() { - let mut q = Queue::new(1); + let q = Queue::new(1); q.push(1); q.push(2); assert_eq!(q.pop(), Some(1)); @@ -282,7 +282,7 @@ mod test { native::task::spawn(proc() { for _ in range(0, 100000) { loop { - match unsafe { (*b.get()).pop() } { + match b.pop() { Some(1) => break, Some(_) => fail!(), None => {} @@ -292,7 +292,7 @@ mod test { tx.send(()); }); for _ in range(0, 100000) { - unsafe { (*a.get()).push(1); } + a.push(1); } rx.recv(); } |
