about summary refs log tree commit diff
path: root/src/libstd/process.rs
diff options
context:
space:
mode:
authorDenys Zariaiev <denys.zariaiev@gmail.com>2019-03-13 21:00:45 +0100
committerDenys Zariaiev <denys.zariaiev@gmail.com>2019-03-13 21:00:45 +0100
commiteeb5f171da2486c34e4e473c97a1468279d05e7c (patch)
treeb452442f799d5d62141419e7091de13c212de9ff /src/libstd/process.rs
parent5c7ec6c421af26666d3ec1c5fe022d099133951c (diff)
parent8bf1f1c8f4100247c1f9b3d9b7aecea5c970263e (diff)
downloadrust-eeb5f171da2486c34e4e473c97a1468279d05e7c.tar.gz
rust-eeb5f171da2486c34e4e473c97a1468279d05e7c.zip
Merge remote-tracking branch 'upstream/master' into asm-compile-tests
Diffstat (limited to 'src/libstd/process.rs')
-rw-r--r--src/libstd/process.rs57
1 files changed, 28 insertions, 29 deletions
diff --git a/src/libstd/process.rs b/src/libstd/process.rs
index a2ef85016d8..56840009344 100644
--- a/src/libstd/process.rs
+++ b/src/libstd/process.rs
@@ -106,17 +106,17 @@
 
 #![stable(feature = "process", since = "1.0.0")]
 
-use io::prelude::*;
-
-use ffi::OsStr;
-use fmt;
-use fs;
-use io::{self, Initializer};
-use path::Path;
-use str;
-use sys::pipe::{read2, AnonPipe};
-use sys::process as imp;
-use sys_common::{AsInner, AsInnerMut, FromInner, IntoInner};
+use crate::io::prelude::*;
+
+use crate::ffi::OsStr;
+use crate::fmt;
+use crate::fs;
+use crate::io::{self, Initializer};
+use crate::path::Path;
+use crate::str;
+use crate::sys::pipe::{read2, AnonPipe};
+use crate::sys::process as imp;
+use crate::sys_common::{AsInner, AsInnerMut, FromInner, IntoInner};
 
 /// Representation of a running or exited child process.
 ///
@@ -1015,7 +1015,7 @@ impl From<ChildStdin> for Stdio {
     ///
     /// `ChildStdin` will be converted to `Stdio` using `Stdio::from` under the hood.
     ///
-    /// ```rust
+    /// ```rust,no_run
     /// use std::process::{Command, Stdio};
     ///
     /// let reverse = Command::new("rev")
@@ -1044,7 +1044,7 @@ impl From<ChildStdout> for Stdio {
     ///
     /// `ChildStdout` will be converted to `Stdio` using `Stdio::from` under the hood.
     ///
-    /// ```rust
+    /// ```rust,no_run
     /// use std::process::{Command, Stdio};
     ///
     /// let hello = Command::new("echo")
@@ -1481,8 +1481,8 @@ impl Child {
 /// [platform-specific behavior]: #platform-specific-behavior
 #[stable(feature = "rust1", since = "1.0.0")]
 pub fn exit(code: i32) -> ! {
-    ::sys_common::cleanup();
-    ::sys::os::exit(code)
+    crate::sys_common::cleanup();
+    crate::sys::os::exit(code)
 }
 
 /// Terminates the process in an abnormal fashion.
@@ -1543,7 +1543,7 @@ pub fn exit(code: i32) -> ! {
 /// [panic hook]: ../../std/panic/fn.set_hook.html
 #[stable(feature = "process_abort", since = "1.17.0")]
 pub fn abort() -> ! {
-    unsafe { ::sys::abort_internal() };
+    unsafe { crate::sys::abort_internal() };
 }
 
 /// Returns the OS-assigned process identifier associated with this process.
@@ -1561,7 +1561,7 @@ pub fn abort() -> ! {
 ///
 #[stable(feature = "getpid", since = "1.26.0")]
 pub fn id() -> u32 {
-    ::sys::os::getpid()
+    crate::sys::os::getpid()
 }
 
 /// A trait for implementing arbitrary return types in the `main` function.
@@ -1623,10 +1623,10 @@ impl Termination for ExitCode {
 
 #[cfg(all(test, not(any(target_os = "cloudabi", target_os = "emscripten"))))]
 mod tests {
-    use io::prelude::*;
+    use crate::io::prelude::*;
 
-    use io::ErrorKind;
-    use str;
+    use crate::io::ErrorKind;
+    use crate::str;
     use super::{Command, Output, Stdio};
 
     // FIXME(#10380) these tests should not all be ignored on android.
@@ -1671,7 +1671,7 @@ mod tests {
     #[cfg(unix)]
     #[cfg_attr(target_os = "android", ignore)]
     fn signal_reported_right() {
-        use os::unix::process::ExitStatusExt;
+        use crate::os::unix::process::ExitStatusExt;
 
         let mut p = Command::new("/bin/sh")
                             .arg("-c").arg("read a")
@@ -1741,8 +1741,8 @@ mod tests {
     #[cfg_attr(target_os = "android", ignore)]
     #[cfg(unix)]
     fn uid_works() {
-        use os::unix::prelude::*;
-        use libc;
+        use crate::os::unix::prelude::*;
+
         let mut p = Command::new("/bin/sh")
                             .arg("-c").arg("true")
                             .uid(unsafe { libc::getuid() })
@@ -1755,8 +1755,7 @@ mod tests {
     #[cfg_attr(target_os = "android", ignore)]
     #[cfg(unix)]
     fn uid_to_root_fails() {
-        use os::unix::prelude::*;
-        use libc;
+        use crate::os::unix::prelude::*;
 
         // if we're already root, this isn't a valid test. Most of the bots run
         // as non-root though (android is an exception).
@@ -1881,7 +1880,7 @@ mod tests {
 
     #[test]
     fn test_override_env() {
-        use env;
+        use crate::env;
 
         // In some build environments (such as chrooted Nix builds), `env` can
         // only be found in the explicitly-provided PATH env variable, not in
@@ -1910,7 +1909,7 @@ mod tests {
 
     #[test]
     fn test_capture_env_at_spawn() {
-        use env;
+        use crate::env;
 
         let mut cmd = env_cmd();
         cmd.env("RUN_TEST_NEW_ENV1", "123");
@@ -1985,8 +1984,8 @@ mod tests {
     #[test]
     #[cfg(windows)]
     fn test_creation_flags() {
-        use os::windows::process::CommandExt;
-        use sys::c::{BOOL, DWORD, INFINITE};
+        use crate::os::windows::process::CommandExt;
+        use crate::sys::c::{BOOL, DWORD, INFINITE};
         #[repr(C, packed)]
         struct DEBUG_EVENT {
             pub event_code: DWORD,