]> git.lizzy.rs Git - rust.git/commitdiff
std: Deprecate the old_io::process module
authorAlex Crichton <alex@alexcrichton.com>
Thu, 5 Mar 2015 18:41:42 +0000 (10:41 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Thu, 5 Mar 2015 18:41:42 +0000 (10:41 -0800)
This module is now superseded by the `std::process` module. This module still
has some room to expand to get quite back up to parity with the `old_io`
version, and there is a [tracking issue][issue] for feature requests as well as
known room for expansion.

[issue]: https://github.com/rust-lang/rfcs/issues/941
[breaking-change]

src/librustc_back/target/apple_ios_base.rs
src/libstd/old_io/process.rs
src/libstd/sys/unix/process.rs
src/libstd/sys/windows/process.rs

index 904b337c03f46e63e664126f01cc470d457c013a..2fbbe7d1f7c5ea60e7865617f78a5ecc8898e4da 100644 (file)
@@ -8,7 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use std::old_io::{Command, IoError, OtherIoError};
+use std::io;
+use std::process::Command;
 use target::TargetOptions;
 
 use self::Arch::*;
@@ -40,16 +41,15 @@ pub fn get_sdk_root(sdk_name: &str) -> String {
                       .arg("--show-sdk-path")
                       .arg("-sdk")
                       .arg(sdk_name)
-                      .spawn()
-                      .and_then(|c| c.wait_with_output())
+                      .output()
                       .and_then(|output| {
                           if output.status.success() {
-                              Ok(String::from_utf8(output.output).unwrap())
+                              Ok(String::from_utf8(output.stdout).unwrap())
                           } else {
-                              Err(IoError {
-                                  kind: OtherIoError,
-                                  desc: "process exit with error",
-                                  detail: String::from_utf8(output.error).ok()})
+                              let error = String::from_utf8(output.stderr);
+                              Err(io::Error::new(io::ErrorKind::Other,
+                                                 "process exit with error",
+                                                 error.ok()))
                           }
                       });
 
index a13295b1ccb5014ea8137156559b628cca769547..e02e863516ab1ebdddcea006f24af713076c48ae 100644 (file)
@@ -11,6 +11,9 @@
 //! Bindings for executing child processes
 
 #![allow(non_upper_case_globals)]
+#![unstable(feature = "old_io")]
+#![deprecated(since = "1.0.0",
+              reason = "replaced with the std::process module")]
 
 pub use self::StdioContainer::*;
 pub use self::ProcessExit::*;
index 68c5c65e7cdb11cfac9bf64ff25732d8efbba32b..62a1799de94c938fe0c3ef9f94ef6632323bff86 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![allow(deprecated)]
+
 use prelude::v1::*;
 use self::Req::*;
 
index 53a037ef07e613a15f30a4e926567078359d4595..ca3ed54eb036a4b2e55e11235fe21d63086dfbfb 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![allow(deprecated)]
+
 use prelude::v1::*;
 
 use collections;