diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-06-14 11:03:34 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-06-15 23:30:24 -0700 |
| commit | 89b0e6e12ba2fb24ec0e6655a1130c16eb8d1745 (patch) | |
| tree | 842308cfd38935989d625db41ffdd22758f8acdb /src/libstd | |
| parent | 6d8342f5e9f7093694548e761ee7df4f55243f3f (diff) | |
| download | rust-89b0e6e12ba2fb24ec0e6655a1130c16eb8d1745.tar.gz rust-89b0e6e12ba2fb24ec0e6655a1130c16eb8d1745.zip | |
Register new snapshots
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/collections/hashmap.rs | 24 | ||||
| -rw-r--r-- | src/libstd/collections/lru_cache.rs | 20 | ||||
| -rw-r--r-- | src/libstd/failure.rs | 4 | ||||
| -rw-r--r-- | src/libstd/io/fs.rs | 2 | ||||
| -rw-r--r-- | src/libstd/io/net/tcp.rs | 8 | ||||
| -rw-r--r-- | src/libstd/io/net/udp.rs | 2 | ||||
| -rw-r--r-- | src/libstd/io/net/unix.rs | 6 | ||||
| -rw-r--r-- | src/libstd/io/pipe.rs | 4 | ||||
| -rw-r--r-- | src/libstd/io/process.rs | 2 | ||||
| -rw-r--r-- | src/libstd/io/signal.rs | 2 | ||||
| -rw-r--r-- | src/libstd/io/stdio.rs | 12 | ||||
| -rw-r--r-- | src/libstd/io/timer.rs | 2 | ||||
| -rw-r--r-- | src/libstd/path/windows.rs | 6 | ||||
| -rw-r--r-- | src/libstd/task.rs | 28 |
14 files changed, 36 insertions, 86 deletions
diff --git a/src/libstd/collections/hashmap.rs b/src/libstd/collections/hashmap.rs index f11e68c7a46..8feb0e0b7ee 100644 --- a/src/libstd/collections/hashmap.rs +++ b/src/libstd/collections/hashmap.rs @@ -1424,18 +1424,6 @@ impl<K: Eq + Hash<S>, V: PartialEq, S, H: Hasher<S>> PartialEq for HashMap<K, V, impl<K: Eq + Hash<S>, V: Eq, S, H: Hasher<S>> Eq for HashMap<K, V, H> {} impl<K: Eq + Hash<S> + Show, V: Show, S, H: Hasher<S>> Show for HashMap<K, V, H> { - #[cfg(stage0)] - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - try!(write!(f, r"\{")); - - for (i, (k, v)) in self.iter().enumerate() { - if i != 0 { try!(write!(f, ", ")); } - try!(write!(f, "{}: {}", *k, *v)); - } - - write!(f, r"\}") - } - #[cfg(not(stage0))] fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { try!(write!(f, "{{")); @@ -1629,18 +1617,6 @@ impl<T: Eq + Hash<S>, S, H: Hasher<S>> HashSet<T, H> { } impl<T: Eq + Hash<S> + fmt::Show, S, H: Hasher<S>> fmt::Show for HashSet<T, H> { - #[cfg(stage0)] - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - try!(write!(f, r"\{")); - - for (i, x) in self.iter().enumerate() { - if i != 0 { try!(write!(f, ", ")); } - try!(write!(f, "{}", *x)); - } - - write!(f, r"\}") - } - #[cfg(not(stage0))] fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { try!(write!(f, "{{")); diff --git a/src/libstd/collections/lru_cache.rs b/src/libstd/collections/lru_cache.rs index 0075a50f389..8ec5146c7b2 100644 --- a/src/libstd/collections/lru_cache.rs +++ b/src/libstd/collections/lru_cache.rs @@ -208,26 +208,6 @@ impl<K: Hash + Eq, V> LruCache<K, V> { impl<A: fmt::Show + Hash + Eq, B: fmt::Show> fmt::Show for LruCache<A, B> { /// Return a string that lists the key-value pairs from most-recently /// used to least-recently used. - #[cfg(stage0)] - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - try!(write!(f, r"\{")); - let mut cur = self.head; - for i in range(0, self.len()) { - if i > 0 { try!(write!(f, ", ")) } - unsafe { - cur = (*cur).next; - try!(write!(f, "{}", (*cur).key)); - } - try!(write!(f, ": ")); - unsafe { - try!(write!(f, "{}", (*cur).value)); - } - } - write!(f, r"\}") - } - /// Return a string that lists the key-value pairs from most-recently - /// used to least-recently used. - #[cfg(not(stage0))] fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { try!(write!(f, "{{")); let mut cur = self.head; diff --git a/src/libstd/failure.rs b/src/libstd/failure.rs index 903f39c7b06..d1552f0bd10 100644 --- a/src/libstd/failure.rs +++ b/src/libstd/failure.rs @@ -23,7 +23,7 @@ use str::Str; use string::String; // Defined in this module instead of io::stdio so that the unwinding -local_data_key!(pub local_stderr: Box<Writer:Send>) +local_data_key!(pub local_stderr: Box<Writer + Send>) impl Writer for Stdio { fn write(&mut self, bytes: &[u8]) -> IoResult<()> { @@ -35,7 +35,7 @@ impl Writer for Stdio { } } -pub fn on_fail(obj: &Any:Send, file: &'static str, line: uint) { +pub fn on_fail(obj: &Any + Send, file: &'static str, line: uint) { let msg = match obj.as_ref::<&'static str>() { Some(s) => *s, None => match obj.as_ref::<String>() { diff --git a/src/libstd/io/fs.rs b/src/libstd/io/fs.rs index 10dfec0f566..20187a6dcde 100644 --- a/src/libstd/io/fs.rs +++ b/src/libstd/io/fs.rs @@ -84,7 +84,7 @@ use vec::Vec; /// configured at creation time, via the `FileAccess` parameter to /// `File::open_mode()`. pub struct File { - fd: Box<rtio::RtioFileStream:Send>, + fd: Box<rtio::RtioFileStream + Send>, path: Path, last_nread: int, } diff --git a/src/libstd/io/net/tcp.rs b/src/libstd/io/net/tcp.rs index 6c773467553..8ffb057c934 100644 --- a/src/libstd/io/net/tcp.rs +++ b/src/libstd/io/net/tcp.rs @@ -51,11 +51,11 @@ use rt::rtio; /// drop(stream); // close the connection /// ``` pub struct TcpStream { - obj: Box<RtioTcpStream:Send>, + obj: Box<RtioTcpStream + Send>, } impl TcpStream { - fn new(s: Box<RtioTcpStream:Send>) -> TcpStream { + fn new(s: Box<RtioTcpStream + Send>) -> TcpStream { TcpStream { obj: s } } @@ -326,7 +326,7 @@ impl Writer for TcpStream { /// # } /// ``` pub struct TcpListener { - obj: Box<RtioTcpListener:Send>, + obj: Box<RtioTcpListener + Send>, } impl TcpListener { @@ -382,7 +382,7 @@ impl Listener<TcpStream, TcpAcceptor> for TcpListener { /// a `TcpListener`'s `listen` method, and this object can be used to accept new /// `TcpStream` instances. pub struct TcpAcceptor { - obj: Box<RtioTcpAcceptor:Send>, + obj: Box<RtioTcpAcceptor + Send>, } impl TcpAcceptor { diff --git a/src/libstd/io/net/udp.rs b/src/libstd/io/net/udp.rs index 538bba36958..e1f9cb3889f 100644 --- a/src/libstd/io/net/udp.rs +++ b/src/libstd/io/net/udp.rs @@ -57,7 +57,7 @@ use rt::rtio; /// drop(socket); // close the socket /// ``` pub struct UdpSocket { - obj: Box<RtioUdpSocket:Send>, + obj: Box<RtioUdpSocket + Send>, } impl UdpSocket { diff --git a/src/libstd/io/net/unix.rs b/src/libstd/io/net/unix.rs index 9715a821e4f..8f4f66836ad 100644 --- a/src/libstd/io/net/unix.rs +++ b/src/libstd/io/net/unix.rs @@ -36,7 +36,7 @@ use rt::rtio::{RtioUnixAcceptor, RtioPipe}; /// A stream which communicates over a named pipe. pub struct UnixStream { - obj: Box<RtioPipe:Send>, + obj: Box<RtioPipe + Send>, } impl UnixStream { @@ -144,7 +144,7 @@ impl Writer for UnixStream { /// A value that can listen for incoming named pipe connection requests. pub struct UnixListener { /// The internal, opaque runtime Unix listener. - obj: Box<RtioUnixListener:Send>, + obj: Box<RtioUnixListener + Send>, } impl UnixListener { @@ -188,7 +188,7 @@ impl Listener<UnixStream, UnixAcceptor> for UnixListener { /// A value that can accept named pipe connections, returned from `listen()`. pub struct UnixAcceptor { /// The internal, opaque runtime Unix acceptor. - obj: Box<RtioUnixAcceptor:Send>, + obj: Box<RtioUnixAcceptor + Send>, } impl UnixAcceptor { diff --git a/src/libstd/io/pipe.rs b/src/libstd/io/pipe.rs index 11bb27573c2..6e2009545aa 100644 --- a/src/libstd/io/pipe.rs +++ b/src/libstd/io/pipe.rs @@ -24,7 +24,7 @@ use rt::rtio::{RtioPipe, LocalIo}; /// A synchronous, in-memory pipe. pub struct PipeStream { /// The internal, opaque runtime pipe object. - obj: Box<RtioPipe:Send>, + obj: Box<RtioPipe + Send>, } impl PipeStream { @@ -55,7 +55,7 @@ impl PipeStream { } #[doc(hidden)] - pub fn new(inner: Box<RtioPipe:Send>) -> PipeStream { + pub fn new(inner: Box<RtioPipe + Send>) -> PipeStream { PipeStream { obj: inner } } } diff --git a/src/libstd/io/process.rs b/src/libstd/io/process.rs index a626d1f3a6c..38d8475ddf7 100644 --- a/src/libstd/io/process.rs +++ b/src/libstd/io/process.rs @@ -58,7 +58,7 @@ use c_str::CString; /// assert!(child.wait().unwrap().success()); /// ``` pub struct Process { - handle: Box<RtioProcess:Send>, + handle: Box<RtioProcess + Send>, /// Handle to the child's stdin, if the `stdin` field of this process's /// `ProcessConfig` was `CreatePipe`. By default, this handle is `Some`. diff --git a/src/libstd/io/signal.rs b/src/libstd/io/signal.rs index 598a8667d41..4a7655a63ce 100644 --- a/src/libstd/io/signal.rs +++ b/src/libstd/io/signal.rs @@ -82,7 +82,7 @@ pub enum Signum { /// ``` pub struct Listener { /// A map from signums to handles to keep the handles in memory - handles: Vec<(Signum, Box<RtioSignal:Send>)>, + handles: Vec<(Signum, Box<RtioSignal + Send>)>, /// This is where all the handles send signums, which are received by /// the clients from the receiver. tx: Sender<Signum>, diff --git a/src/libstd/io/stdio.rs b/src/libstd/io/stdio.rs index 84b91814c87..071480fb5ee 100644 --- a/src/libstd/io/stdio.rs +++ b/src/libstd/io/stdio.rs @@ -71,8 +71,8 @@ use str::StrSlice; // tl;dr; TTY works on everything but when windows stdout is redirected, in that // case pipe also doesn't work, but magically file does! enum StdSource { - TTY(Box<RtioTTY:Send>), - File(Box<RtioFileStream:Send>), + TTY(Box<RtioTTY + Send>), + File(Box<RtioFileStream + Send>), } fn src<T>(fd: libc::c_int, readable: bool, f: |StdSource| -> T) -> T { @@ -84,7 +84,7 @@ fn src<T>(fd: libc::c_int, readable: bool, f: |StdSource| -> T) -> T { }).map_err(IoError::from_rtio_error).unwrap() } -local_data_key!(local_stdout: Box<Writer:Send>) +local_data_key!(local_stdout: Box<Writer + Send>) /// Creates a new non-blocking handle to the stdin of the current process. /// @@ -163,7 +163,7 @@ pub fn stderr_raw() -> StdWriter { /// /// Note that this does not need to be called for all new tasks; the default /// output handle is to the process's stdout stream. -pub fn set_stdout(stdout: Box<Writer:Send>) -> Option<Box<Writer:Send>> { +pub fn set_stdout(stdout: Box<Writer + Send>) -> Option<Box<Writer + Send>> { local_stdout.replace(Some(stdout)).and_then(|mut s| { let _ = s.flush(); Some(s) @@ -178,7 +178,7 @@ pub fn set_stdout(stdout: Box<Writer:Send>) -> Option<Box<Writer:Send>> { /// /// Note that this does not need to be called for all new tasks; the default /// output handle is to the process's stderr stream. -pub fn set_stderr(stderr: Box<Writer:Send>) -> Option<Box<Writer:Send>> { +pub fn set_stderr(stderr: Box<Writer + Send>) -> Option<Box<Writer + Send>> { local_stderr.replace(Some(stderr)).and_then(|mut s| { let _ = s.flush(); Some(s) @@ -198,7 +198,7 @@ pub fn set_stderr(stderr: Box<Writer:Send>) -> Option<Box<Writer:Send>> { fn with_task_stdout(f: |&mut Writer| -> IoResult<()>) { let result = if Local::exists(None::<Task>) { let mut my_stdout = local_stdout.replace(None).unwrap_or_else(|| { - box stdout() as Box<Writer:Send> + box stdout() as Box<Writer + Send> }); let result = f(my_stdout); local_stdout.replace(Some(my_stdout)); diff --git a/src/libstd/io/timer.rs b/src/libstd/io/timer.rs index 1529cf8f92d..da099953a49 100644 --- a/src/libstd/io/timer.rs +++ b/src/libstd/io/timer.rs @@ -64,7 +64,7 @@ use rt::rtio::{IoFactory, LocalIo, RtioTimer, Callback}; /// # } /// ``` pub struct Timer { - obj: Box<RtioTimer:Send>, + obj: Box<RtioTimer + Send>, } struct TimerCallback { tx: Sender<()> } diff --git a/src/libstd/path/windows.rs b/src/libstd/path/windows.rs index b9bb0054d44..553c7af18cb 100644 --- a/src/libstd/path/windows.rs +++ b/src/libstd/path/windows.rs @@ -899,12 +899,6 @@ pub fn make_non_verbatim(path: &Path) -> Option<Path> { // \\?\D:\ Path::new(repr.slice_from(4)) } - #[cfg(stage0)] - Some(VerbatimUNCPrefix(_,_)) => { - // \\?\UNC\server\share - Path::new(format!(r"\\{}", repr.slice_from(7))) - } - #[cfg(not(stage0))] Some(VerbatimUNCPrefix(_,_)) => { // \\?\UNC\server\share Path::new(format!(r"\{}", repr.slice_from(7))) diff --git a/src/libstd/task.rs b/src/libstd/task.rs index a4e1ad84252..f543188af42 100644 --- a/src/libstd/task.rs +++ b/src/libstd/task.rs @@ -63,9 +63,9 @@ pub struct TaskOpts { /// The size of the stack for the spawned task pub stack_size: Option<uint>, /// Task-local stdout - pub stdout: Option<Box<Writer:Send>>, + pub stdout: Option<Box<Writer + Send>>, /// Task-local stderr - pub stderr: Option<Box<Writer:Send>>, + pub stderr: Option<Box<Writer + Send>>, } /** @@ -83,7 +83,7 @@ pub struct TaskOpts { pub struct TaskBuilder { /// Options to spawn the new task with pub opts: TaskOpts, - gen_body: Option<proc(v: proc():Send):Send -> proc():Send>, + gen_body: Option<proc(v: proc(): Send): Send -> proc(): Send>, nocopy: marker::NoCopy, } @@ -146,7 +146,7 @@ impl TaskBuilder { * existing body generator to the new body generator. */ pub fn with_wrapper(mut self, - wrapper: proc(v: proc():Send):Send -> proc():Send) + wrapper: proc(v: proc(): Send): Send -> proc(): Send) -> TaskBuilder { self.gen_body = match self.gen_body.take() { @@ -163,7 +163,7 @@ impl TaskBuilder { * the provided unique closure. The task has the properties and behavior * specified by the task_builder. */ - pub fn spawn(mut self, f: proc():Send) { + pub fn spawn(mut self, f: proc(): Send) { let gen_body = self.gen_body.take(); let f = match gen_body { Some(gen) => gen(f), @@ -204,8 +204,8 @@ impl TaskBuilder { * # Failure * Fails if a future_result was already set for this task. */ - pub fn try<T:Send>(mut self, f: proc():Send -> T) - -> Result<T, Box<Any:Send>> { + pub fn try<T: Send>(mut self, f: proc(): Send -> T) + -> Result<T, Box<Any + Send>> { let (tx, rx) = channel(); let result = self.future_result(); @@ -247,7 +247,7 @@ impl TaskOpts { /// the provided unique closure. /// /// This function is equivalent to `TaskBuilder::new().spawn(f)`. -pub fn spawn(f: proc():Send) { +pub fn spawn(f: proc(): Send) { TaskBuilder::new().spawn(f) } @@ -255,7 +255,7 @@ pub fn spawn(f: proc():Send) { /// the function or an error if the task failed /// /// This is equivalent to TaskBuilder::new().try -pub fn try<T:Send>(f: proc():Send -> T) -> Result<T, Box<Any:Send>> { +pub fn try<T: Send>(f: proc(): Send -> T) -> Result<T, Box<Any + Send>> { TaskBuilder::new().try(f) } @@ -344,7 +344,7 @@ fn test_run_basic() { fn test_with_wrapper() { let (tx, rx) = channel(); TaskBuilder::new().with_wrapper(proc(body) { - let result: proc():Send = proc() { + let result: proc(): Send = proc() { body(); tx.send(()); }; @@ -430,7 +430,7 @@ fn test_spawn_sched_childs_on_default_sched() { } #[cfg(test)] -fn avoid_copying_the_body(spawnfn: |v: proc():Send|) { +fn avoid_copying_the_body(spawnfn: |v: proc(): Send|) { let (tx, rx) = channel::<uint>(); let x = box 1; @@ -476,7 +476,7 @@ fn test_child_doesnt_ref_parent() { // (well, it would if the constant were 8000+ - I lowered it to be more // valgrind-friendly. try this at home, instead..!) static generations: uint = 16; - fn child_no(x: uint) -> proc():Send { + fn child_no(x: uint) -> proc(): Send { return proc() { if x < generations { TaskBuilder::new().spawn(child_no(x+1)); @@ -522,10 +522,10 @@ fn test_try_fail_message_owned_str() { #[test] fn test_try_fail_message_any() { match try(proc() { - fail!(box 413u16 as Box<Any:Send>); + fail!(box 413u16 as Box<Any + Send>); }) { Err(e) => { - type T = Box<Any:Send>; + type T = Box<Any + Send>; assert!(e.is::<T>()); let any = e.move::<T>().unwrap(); assert!(any.is::<u16>()); |
