Rebase test fixes v2

This commit is contained in:
Alex Crichton 2015-01-02 12:05:24 -08:00
parent 4459b1dced
commit 8cf9929a9a
3 changed files with 22 additions and 10 deletions

View File

@ -18,9 +18,17 @@ trait From<Src> {
trait To { trait To {
// This is a typo, the return type should be `<Dst as From<Self>>::Output` // 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 { fn to<Dst: From<Self>>(
//~^ error: the trait `core::kinds::Sized` is not implemented self
From::from(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
)
} }
} }

View File

@ -17,8 +17,12 @@ trait From<Src> {
} }
trait To { trait To {
fn to<Dst>(self) -> <Dst as From<Self>>::Result where Dst: From<Self> { fn to<Dst>(
From::from(self) //~error: type annotations required 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
)
} }
} }

View File

@ -17,7 +17,7 @@
extern crate log; extern crate log;
extern crate libc; extern crate libc;
use std::comm::channel; use std::sync::mpsc::channel;
use std::io::net::tcp::{TcpListener, TcpStream}; use std::io::net::tcp::{TcpListener, TcpStream};
use std::io::{Acceptor, Listener}; use std::io::{Acceptor, Listener};
use std::thread::{Builder, Thread}; use std::thread::{Builder, Thread};
@ -35,7 +35,7 @@ fn main() {
let (tx, rx) = channel(); let (tx, rx) = channel();
Thread::spawn(move || -> () { Thread::spawn(move || -> () {
let mut listener = TcpListener::bind("127.0.0.1:0").unwrap(); 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(); let mut acceptor = listener.listen();
loop { loop {
let mut stream = match acceptor.accept() { let mut stream = match acceptor.accept() {
@ -49,7 +49,7 @@ fn main() {
stream.write(&[2]); stream.write(&[2]);
} }
}).detach(); }).detach();
let addr = rx.recv(); let addr = rx.recv().unwarp();
let (tx, rx) = channel(); let (tx, rx) = channel();
for _ in range(0u, 1000) { for _ in range(0u, 1000) {
@ -64,7 +64,7 @@ fn main() {
}, },
Err(e) => debug!("{}", e) Err(e) => debug!("{}", e)
} }
tx.send(()); tx.send(()).unwrap();
}).detach(); }).detach();
} }
@ -72,7 +72,7 @@ fn main() {
// server just runs infinitely. // server just runs infinitely.
drop(tx); drop(tx);
for _ in range(0u, 1000) { for _ in range(0u, 1000) {
rx.recv(); rx.recv().unwrap();
} }
unsafe { libc::exit(0) } unsafe { libc::exit(0) }
} }