]> git.lizzy.rs Git - rust.git/blobdiff - src/test/run-pass/comm.rs
cleanup: s/impl Copy/#[derive(Copy)]/g
[rust.git] / src / test / run-pass / comm.rs
index edd4d5642b5bf9ac7e58d0fde35ad6c13f8ce593..16a21adc3fcf90067067a902b385128f267b4869 100644 (file)
@@ -8,12 +8,13 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use std::task;
+use std::thread::Thread;
+use std::sync::mpsc::{channel, Sender};
 
 pub fn main() {
     let (tx, rx) = channel();
-    let _t = task::spawn(move|| { child(&tx) });
-    let y = rx.recv();
+    let _t = Thread::spawn(move|| { child(&tx) });
+    let y = rx.recv().unwrap();
     println!("received");
     println!("{}", y);
     assert_eq!(y, 10);
@@ -21,6 +22,6 @@ pub fn main() {
 
 fn child(c: &Sender<int>) {
     println!("sending");
-    c.send(10);
+    c.send(10).unwrap();
     println!("value sent");
 }