]> git.lizzy.rs Git - rust.git/commitdiff
Rebase test fixes v2
authorAlex Crichton <alex@alexcrichton.com>
Fri, 2 Jan 2015 20:05:24 +0000 (12:05 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Fri, 2 Jan 2015 20:09:47 +0000 (12:09 -0800)
src/test/compile-fail/issue-19883.rs
src/test/compile-fail/issue-20005.rs
src/test/run-pass/tcp-stress.rs

index b86e553e100ddc289e0847eadd3cf40543ecdc67..196a04db18a3886de1b8793573380b960293c4ca 100644 (file)
@@ -18,9 +18,17 @@ trait From<Src> {
 
 trait To {
     // This is a typo, the return type should be `<Dst as From<Self>>::Output`
-    fn to<Dst: From<Self>>(self) -> <Dst as From<Self>>::Dst {
-    //~^ error: the trait `core::kinds::Sized` is not implemented
-        From::from(self)
+    fn to<Dst: From<Self>>(
+        self
+        //~^ error: the trait `core::kinds::Sized` is not implemented
+    ) ->
+        <Dst as From<Self>>::Dst
+        //~^ error: the trait `core::kinds::Sized` is not implemented
+    {
+        From::from(
+            //~^ error: the trait `core::kinds::Sized` is not implemented
+            self
+        )
     }
 }
 
index d5b04c1864367206824c881aa146fe846417bc55..d9520583ca53bc7e9ec8deb38f2576dbf8eb3546 100644 (file)
@@ -17,8 +17,12 @@ trait From<Src> {
 }
 
 trait To {
-    fn to<Dst>(self) -> <Dst as From<Self>>::Result where Dst: From<Self> {
-        From::from(self)  //~error: type annotations required
+    fn to<Dst>(
+        self //~ error: the trait `core::kinds::Sized` is not implemented
+    ) -> <Dst as From<Self>>::Result where Dst: From<Self> {
+        From::from( //~ error: the trait `core::kinds::Sized` is not implemented
+            self
+        )
     }
 }
 
index 7a061f5b99c51b5cf13e36bd2c3eaa6010ebb350..2efd0ad14bdd6d265bb35b02d1a0b8b9f0054816 100644 (file)
@@ -17,7 +17,7 @@
 extern crate log;
 extern crate libc;
 
-use std::comm::channel;
+use std::sync::mpsc::channel;
 use std::io::net::tcp::{TcpListener, TcpStream};
 use std::io::{Acceptor, Listener};
 use std::thread::{Builder, Thread};
@@ -35,7 +35,7 @@ fn main() {
     let (tx, rx) = channel();
     Thread::spawn(move || -> () {
         let mut listener = TcpListener::bind("127.0.0.1:0").unwrap();
-        tx.send(listener.socket_name().unwrap());
+        tx.send(listener.socket_name().unwrap()).unwrap();
         let mut acceptor = listener.listen();
         loop {
             let mut stream = match acceptor.accept() {
@@ -49,7 +49,7 @@ fn main() {
             stream.write(&[2]);
         }
     }).detach();
-    let addr = rx.recv();
+    let addr = rx.recv().unwarp();
 
     let (tx, rx) = channel();
     for _ in range(0u, 1000) {
@@ -64,7 +64,7 @@ fn main() {
                 },
                 Err(e) => debug!("{}", e)
             }
-            tx.send(());
+            tx.send(()).unwrap();
         }).detach();
     }
 
@@ -72,7 +72,7 @@ fn main() {
     // server just runs infinitely.
     drop(tx);
     for _ in range(0u, 1000) {
-        rx.recv();
+        rx.recv().unwrap();
     }
     unsafe { libc::exit(0) }
 }