]> git.lizzy.rs Git - rust.git/blobdiff - src/libstd/sync/mpsc/mpsc_queue.rs
Replace `0 as *const/mut T` with `ptr::null/null_mut()`
[rust.git] / src / libstd / sync / mpsc / mpsc_queue.rs
index 9ad24a5a11ec5dfb61080a507b4d4a61920a8198..ea81ed30a9c603b6b72e2ca1473c920444916cf4 100644 (file)
@@ -35,7 +35,7 @@
 //! method, and see the method for more information about it. Due to this
 //! caveat, this queue may not be appropriate for all use-cases.
 
-#![experimental]
+#![unstable]
 
 // http://www.1024cores.net/home/lock-free-algorithms
 //                         /queues/non-intrusive-mpsc-node-based-queue
@@ -46,6 +46,7 @@
 
 use alloc::boxed::Box;
 use core::mem;
+use core::ptr;
 use core::cell::UnsafeCell;
 
 use sync::atomic::{AtomicPtr, Ordering};
@@ -82,7 +83,7 @@ unsafe impl<T:Send> Sync for Queue<T> { }
 impl<T> Node<T> {
     unsafe fn new(v: Option<T>) -> *mut Node<T> {
         mem::transmute(box Node {
-            next: AtomicPtr::new(0 as *mut Node<T>),
+            next: AtomicPtr::new(ptr::null_mut()),
             value: v,
         })
     }
@@ -188,7 +189,7 @@ fn test() {
                     q.push(i);
                 }
                 tx.send(()).unwrap();
-            }).detach();
+            });
         }
 
         let mut i = 0u;