From 8cf9929a9a901b68d4624167542924e8b181e96a Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Fri, 2 Jan 2015 12:05:24 -0800 Subject: [PATCH] Rebase test fixes v2 --- src/test/compile-fail/issue-19883.rs | 14 +++++++++++--- src/test/compile-fail/issue-20005.rs | 8 ++++++-- src/test/run-pass/tcp-stress.rs | 10 +++++----- 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/src/test/compile-fail/issue-19883.rs b/src/test/compile-fail/issue-19883.rs index b86e553e100..196a04db18a 100644 --- a/src/test/compile-fail/issue-19883.rs +++ b/src/test/compile-fail/issue-19883.rs @@ -18,9 +18,17 @@ trait From { trait To { // This is a typo, the return type should be `>::Output` - fn to>(self) -> >::Dst { - //~^ error: the trait `core::kinds::Sized` is not implemented - From::from(self) + fn to>( + self + //~^ error: the trait `core::kinds::Sized` is not implemented + ) -> + >::Dst + //~^ error: the trait `core::kinds::Sized` is not implemented + { + From::from( + //~^ error: the trait `core::kinds::Sized` is not implemented + self + ) } } diff --git a/src/test/compile-fail/issue-20005.rs b/src/test/compile-fail/issue-20005.rs index d5b04c18643..d9520583ca5 100644 --- a/src/test/compile-fail/issue-20005.rs +++ b/src/test/compile-fail/issue-20005.rs @@ -17,8 +17,12 @@ trait From { } trait To { - fn to(self) -> >::Result where Dst: From { - From::from(self) //~error: type annotations required + fn to( + self //~ error: the trait `core::kinds::Sized` is not implemented + ) -> >::Result where Dst: From { + From::from( //~ error: the trait `core::kinds::Sized` is not implemented + self + ) } } diff --git a/src/test/run-pass/tcp-stress.rs b/src/test/run-pass/tcp-stress.rs index 7a061f5b99c..2efd0ad14bd 100644 --- a/src/test/run-pass/tcp-stress.rs +++ b/src/test/run-pass/tcp-stress.rs @@ -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) } }