]> git.lizzy.rs Git - rust.git/blobdiff - src/libstd/io/process.rs
rollup merge of #21457: alexcrichton/issue-21436
[rust.git] / src / libstd / io / process.rs
index 55df6330dd33c463bec0e55d5d005b3573651fb8..c2f52f5c8a3b45c637a3ab3145b93fda67300cfc 100644 (file)
@@ -10,7 +10,7 @@
 
 //! Bindings for executing child processes
 
-#![allow(experimental)]
+#![allow(unstable)]
 #![allow(non_upper_case_globals)]
 
 pub use self::StdioContainer::*;
@@ -21,7 +21,6 @@
 use collections::HashMap;
 use ffi::CString;
 use fmt;
-use hash::Hash;
 use io::pipe::{PipeStream, PipePair};
 use io::{IoResult, IoError};
 use io;
@@ -34,7 +33,7 @@
 use sys;
 use thread::Thread;
 
-#[cfg(windows)] use std::hash::sip::SipState;
+#[cfg(windows)] use hash;
 #[cfg(windows)] use str;
 
 /// Signal a process to exit, without forcibly killing it. Corresponds to
@@ -98,7 +97,7 @@ pub struct Process {
 /// A representation of environment variable name
 /// It compares case-insensitive on Windows and case-sensitive everywhere else.
 #[cfg(not(windows))]
-#[derive(PartialEq, Eq, Hash, Clone, Show)]
+#[derive(Hash, PartialEq, Eq, Clone, Show)]
 struct EnvKey(CString);
 
 #[doc(hidden)]
@@ -107,8 +106,8 @@ pub struct Process {
 struct EnvKey(CString);
 
 #[cfg(windows)]
-impl Hash for EnvKey {
-    fn hash(&self, state: &mut SipState) {
+impl<H: hash::Writer + hash::Hasher> hash::Hash<H> for EnvKey {
+    fn hash(&self, state: &mut H) {
         let &EnvKey(ref x) = self;
         match str::from_utf8(x.as_bytes()) {
             Ok(s) => for ch in s.chars() {
@@ -395,14 +394,7 @@ pub fn status(&self) -> IoResult<ProcessExit> {
     }
 }
 
-#[cfg(stage0)]
-impl fmt::Show for Command {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        fmt::String::fmt(self, f)
-    }
-}
-
-impl fmt::String for Command {
+impl fmt::Debug for Command {
     /// Format the program and arguments of a Command for display. Any
     /// non-utf8 data is lossily converted using the utf8 replacement
     /// character.
@@ -501,7 +493,7 @@ pub enum StdioContainer {
 
 /// Describes the result of a process after it has terminated.
 /// Note that Windows have no signals, so the result is usually ExitStatus.
-#[derive(PartialEq, Eq, Clone, Copy)]
+#[derive(PartialEq, Eq, Clone, Copy, Show)]
 pub enum ProcessExit {
     /// Normal termination with an exit status.
     ExitStatus(int),
@@ -510,15 +502,8 @@ pub enum ProcessExit {
     ExitSignal(int),
 }
 
-impl fmt::Show for ProcessExit {
-    /// Format a ProcessExit enum, to nicely present the information.
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
-        fmt::String::fmt(self, f)
-    }
-}
-
-
-impl fmt::String for ProcessExit {
+#[stable]
+impl fmt::Display for ProcessExit {
     /// Format a ProcessExit enum, to nicely present the information.
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         match *self {
@@ -668,7 +653,7 @@ pub fn wait(&mut self) -> IoResult<ProcessExit> {
     /// # Example
     ///
     /// ```no_run
-    /// # #![allow(experimental)]
+    /// # #![allow(unstable)]
     /// use std::io::{Command, IoResult};
     /// use std::io::process::ProcessExit;
     ///
@@ -696,7 +681,7 @@ pub fn wait(&mut self) -> IoResult<ProcessExit> {
     ///     p.wait()
     /// }
     /// ```
-    #[experimental = "the type of the timeout is likely to change"]
+    #[unstable = "the type of the timeout is likely to change"]
     pub fn set_timeout(&mut self, timeout_ms: Option<u64>) {
         self.deadline = timeout_ms.map(|i| i + sys::timer::now()).unwrap_or(0);
     }