mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-15 13:36:49 +00:00
Rebase test fixes v2
This commit is contained in:
parent
4459b1dced
commit
8cf9929a9a
@ -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
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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) }
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user