Skip to content

Commit a77fe99

Browse files
committed
---
yaml --- r: 146163 b: refs/heads/try2 c: 4ce71ea h: refs/heads/master i: 146161: 9ef687c 146159: 578a8a9 v: v3
1 parent f6c6b3e commit a77fe99

File tree

5 files changed

+15
-20
lines changed

5 files changed

+15
-20
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 59d45b8fe793d369ddf600cce0f212f9b6165a30
8+
refs/heads/try2: 4ce71eaca34526d0e3ee1ebf0658d2a20d388ef2
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/libstd/rt/io/net/tcp.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use result::{Ok, Err};
1313
use rt::io::net::ip::SocketAddr;
1414
use rt::io::{Reader, Writer, Listener, Acceptor};
1515
use rt::io::{io_error, read_error, EndOfFile};
16-
use rt::rtio::{IoFactory, RtioTcpListenerObject, with_local_io,
16+
use rt::rtio::{IoFactory, with_local_io,
1717
RtioSocket, RtioTcpListener, RtioTcpAcceptor, RtioTcpStream};
1818

1919
pub struct TcpStream {
@@ -89,7 +89,7 @@ impl Writer for TcpStream {
8989
}
9090

9191
pub struct TcpListener {
92-
priv obj: ~RtioTcpListenerObject
92+
priv obj: ~RtioTcpListener
9393
}
9494

9595
impl TcpListener {

branches/try2/src/libstd/rt/io/net/unix.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ use prelude::*;
2626

2727
use c_str::ToCStr;
2828
use rt::rtio::{IoFactory, RtioUnixListener, with_local_io};
29-
use rt::rtio::{RtioUnixAcceptor, RtioPipe, RtioUnixListenerObject};
29+
use rt::rtio::{RtioUnixAcceptor, RtioPipe};
3030
use rt::io::pipe::PipeStream;
3131
use rt::io::{io_error, Listener, Acceptor, Reader, Writer};
3232

@@ -82,7 +82,7 @@ impl Writer for UnixStream {
8282
}
8383

8484
pub struct UnixListener {
85-
priv obj: ~RtioUnixListenerObject,
85+
priv obj: ~RtioUnixListener,
8686
}
8787

8888
impl UnixListener {

branches/try2/src/libstd/rt/rtio.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,10 @@ use ai = rt::io::net::addrinfo;
1818
use rt::io::IoError;
1919
use super::io::process::ProcessConfig;
2020
use super::io::net::ip::{IpAddr, SocketAddr};
21-
use rt::uv::uvio;
2221
use path::Path;
2322
use super::io::{SeekStyle};
2423
use super::io::{FileMode, FileAccess, FileStat};
2524

26-
// FIXME(#9893) cannot call by-value self method on a trait object
27-
pub type RtioTcpListenerObject = uvio::UvTcpListener;
28-
pub type RtioUnixListenerObject = uvio::UvUnixListener;
29-
3025
pub trait EventLoop {
3126
fn run(&mut self);
3227
fn callback(&mut self, ~fn());
@@ -82,7 +77,7 @@ pub fn with_local_io<T>(f: &fn(&mut IoFactory) -> Option<T>) -> Option<T> {
8277

8378
pub trait IoFactory {
8479
fn tcp_connect(&mut self, addr: SocketAddr) -> Result<~RtioTcpStream, IoError>;
85-
fn tcp_bind(&mut self, addr: SocketAddr) -> Result<~RtioTcpListenerObject, IoError>;
80+
fn tcp_bind(&mut self, addr: SocketAddr) -> Result<~RtioTcpListener, IoError>;
8681
fn udp_bind(&mut self, addr: SocketAddr) -> Result<~RtioUdpSocket, IoError>;
8782
fn get_host_addresses(&mut self, host: Option<&str>, servname: Option<&str>,
8883
hint: Option<ai::Hint>) -> Result<~[ai::Info], IoError>;
@@ -100,14 +95,14 @@ pub trait IoFactory {
10095
-> Result<(~RtioProcess, ~[Option<~RtioPipe>]), IoError>;
10196

10297
fn unix_bind(&mut self, path: &CString) ->
103-
Result<~RtioUnixListenerObject, IoError>;
98+
Result<~RtioUnixListener, IoError>;
10499
fn unix_connect(&mut self, path: &CString) -> Result<~RtioPipe, IoError>;
105100
fn tty_open(&mut self, fd: c_int, readable: bool, close_on_drop: bool)
106101
-> Result<~RtioTTY, IoError>;
107102
}
108103

109104
pub trait RtioTcpListener : RtioSocket {
110-
fn listen(self) -> Result<~RtioTcpAcceptor, IoError>;
105+
fn listen(~self) -> Result<~RtioTcpAcceptor, IoError>;
111106
}
112107

113108
pub trait RtioTcpAcceptor : RtioSocket {
@@ -173,7 +168,7 @@ pub trait RtioPipe {
173168
}
174169

175170
pub trait RtioUnixListener {
176-
fn listen(self) -> Result<~RtioUnixAcceptor, IoError>;
171+
fn listen(~self) -> Result<~RtioUnixAcceptor, IoError>;
177172
}
178173

179174
pub trait RtioUnixAcceptor {

branches/try2/src/libstd/rt/uv/uvio.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -493,12 +493,12 @@ impl IoFactory for UvIoFactory {
493493
return result_cell.take();
494494
}
495495

496-
fn tcp_bind(&mut self, addr: SocketAddr) -> Result<~RtioTcpListenerObject, IoError> {
496+
fn tcp_bind(&mut self, addr: SocketAddr) -> Result<~RtioTcpListener, IoError> {
497497
let mut watcher = TcpWatcher::new(self.uv_loop());
498498
match watcher.bind(addr) {
499499
Ok(_) => {
500500
let home = get_handle_to_current_scheduler!();
501-
Ok(~UvTcpListener::new(watcher, home))
501+
Ok(~UvTcpListener::new(watcher, home) as ~RtioTcpListener)
502502
}
503503
Err(uverr) => {
504504
do task::unkillable { // FIXME(#8674)
@@ -804,13 +804,13 @@ impl IoFactory for UvIoFactory {
804804
}
805805

806806
fn unix_bind(&mut self, path: &CString) ->
807-
Result<~RtioUnixListenerObject, IoError> {
807+
Result<~RtioUnixListener, IoError> {
808808
let mut pipe = Pipe::new(self.uv_loop(), false);
809809
match pipe.bind(path) {
810810
Ok(()) => {
811811
let handle = get_handle_to_current_scheduler!();
812812
let pipe = UvUnboundPipe::new(pipe, handle);
813-
Ok(~UvUnixListener::new(pipe))
813+
Ok(~UvUnixListener::new(pipe) as ~RtioUnixListener)
814814
}
815815
Err(e) => {
816816
let scheduler: ~Scheduler = Local::take();
@@ -919,7 +919,7 @@ impl RtioSocket for UvTcpListener {
919919
}
920920

921921
impl RtioTcpListener for UvTcpListener {
922-
fn listen(self) -> Result<~RtioTcpAcceptor, IoError> {
922+
fn listen(~self) -> Result<~RtioTcpAcceptor, IoError> {
923923
do self.home_for_io_consume |self_| {
924924
let acceptor = ~UvTcpAcceptor::new(self_);
925925
let incoming = Cell::new(acceptor.incoming.clone());
@@ -1717,7 +1717,7 @@ impl UvUnixListener {
17171717
}
17181718

17191719
impl RtioUnixListener for UvUnixListener {
1720-
fn listen(self) -> Result<~RtioUnixAcceptor, IoError> {
1720+
fn listen(~self) -> Result<~RtioUnixAcceptor, IoError> {
17211721
do self.home_for_io_consume |self_| {
17221722
let acceptor = ~UvUnixAcceptor::new(self_);
17231723
let incoming = Cell::new(acceptor.incoming.clone());

0 commit comments

Comments
 (0)