Skip to content
Merged
Changes from 3 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
6293dca
Change Debug impl of SocketAddr and IpAddr to match their Display output
LukasKalbertodt Jul 16, 2020
3a02e06
BTreeMap: purge innocent use of into_kv_mut
ssomers Aug 5, 2020
e005b71
Switch to intra-doc links in `std::process`
camelid Aug 12, 2020
d8f9614
Use `Child::std{in,out,err}` instead of `Child.`
camelid Aug 12, 2020
bbad31d
Clean up E0752 explanation
GuillaumeGomez Aug 13, 2020
406719b
Improve wording
GuillaumeGomez Aug 13, 2020
0ce97fc
Fix code examples
GuillaumeGomez Aug 13, 2020
2adc8c0
Move to intra doc links in std::ffi
poliorcetics Aug 13, 2020
643258f
Tweak suggestion for `this` -> `self`
estebank Aug 14, 2020
360388b
Suggest adding `&self` when accessing `self` in static assoc `fn`
estebank Aug 14, 2020
b77c40e
Do not emit E0228 when it is implied by E0106
estebank Aug 14, 2020
dba647e
Remove liballoc unneeded explicit link
pickfire Jul 9, 2020
e0d215f
Update src/liballoc/vec.rs
pickfire Jul 23, 2020
d2ecfcf
Update liballoc vec doc link
pickfire Jul 24, 2020
28bca67
Bump std's libc version to 0.2.74
workingjubilee Aug 14, 2020
6e11329
mention 'lifetime extension' in promotion doc comments
RalfJung Aug 14, 2020
7805c20
answer an old question re: intern kinds
RalfJung Aug 14, 2020
d0d9048
add a FIXME concerning interning of promoteds
RalfJung Aug 14, 2020
90e4c90
Improve documentation on process::Child.std* fields
xkr47 Jul 9, 2020
421e0ff
BTreeMap: refactor splitpoint and move testing over to unit test
ssomers Aug 14, 2020
8d1c3c1
BTreeMap: refactor splitpoint and move testing over to unit test
ssomers Aug 14, 2020
232e3d0
Switch to intra-doc links in os/raw/*.md
nixphix Aug 14, 2020
ff45df2
Move btree unit test to their native, privileged location
ssomers Aug 14, 2020
84539eb
remove primitive type links
nixphix Aug 14, 2020
ee4f893
Apply suggestions from code review
poliorcetics Aug 14, 2020
4ecdec1
review comment: suggestion message wording
estebank Aug 14, 2020
e97fa1e
libstd/ffi/c_str.rs: #![deny(unsafe_op_in_unsafe_fn)], enclose unsafe…
poliorcetics Aug 14, 2020
61866bc
Use intra-doc links in `mem::manually_drop` & `mem::maybe_uninit`
Aug 6, 2020
0e610bb
Document the unsafe keyword
poliorcetics Aug 14, 2020
f163ec5
Rollup merge of #73943 - poliorcetics:unsafe-keyword, r=steveklabnik
tmandry Aug 14, 2020
fba3989
Rollup merge of #74062 - poliorcetics:unsafe-in-unsafe-c_str, r=Mark-…
tmandry Aug 14, 2020
3111a8c
Rollup merge of #74185 - pickfire:liballoc-iter-doc, r=jyn514
tmandry Aug 14, 2020
dae020d
Rollup merge of #74192 - xkr47:patch-1, r=Mark-Simulacrum
tmandry Aug 14, 2020
5b61230
Rollup merge of #74409 - LukasKalbertodt:improve-debug-impl-of-socket…
tmandry Aug 14, 2020
83e75ac
Rollup merge of #75195 - ssomers:btree_split_up_into_kv_mut, r=Mark-S…
tmandry Aug 14, 2020
ad8c5e1
Rollup merge of #75214 - chansuke:fix-intra-doc-links, r=jyn514
tmandry Aug 14, 2020
b026181
Rollup merge of #75432 - camelid:intra-doc-links-for-std-process, r=j…
tmandry Aug 14, 2020
1cf79ec
Rollup merge of #75482 - GuillaumeGomez:cleanup-e0752, r=pickfire
tmandry Aug 14, 2020
ad1bfd2
Rollup merge of #75501 - poliorcetics:intra-links-std-ffi, r=jyn514
tmandry Aug 14, 2020
2fb2af4
Rollup merge of #75509 - estebank:coming-merrily-from-java-land, r=lcnr
tmandry Aug 14, 2020
0c8c3b9
Rollup merge of #75511 - estebank:elide-trait-object-lt-error, r=lcnr
tmandry Aug 14, 2020
83c0439
Rollup merge of #75515 - workingjubilee:patch-4, r=Mark-Simulacrum
tmandry Aug 14, 2020
00e2dcb
Rollup merge of #75517 - RalfJung:promo-intern-comments, r=oli-obk
tmandry Aug 14, 2020
2564135
Rollup merge of #75519 - ssomers:btree_splitpoint_cleanup, r=Mark-Sim…
tmandry Aug 14, 2020
6d09e29
Rollup merge of #75530 - nixphix:docs/os-raw, r=jyn514
tmandry Aug 14, 2020
939befd
Rollup merge of #75531 - ssomers:btree_tests_migration, r=Mark-Simula…
tmandry Aug 14, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
95 changes: 37 additions & 58 deletions library/std/src/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,25 +84,15 @@
//! assert_eq!(b"test", output.stdout.as_slice());
//! ```
//!
//! [`abort`]: fn.abort.html
//! [`exit`]: fn.exit.html
//! [`spawn`]: Command::spawn
//! [`output`]: Command::output
//!
//! [`Command`]: struct.Command.html
//! [`spawn`]: struct.Command.html#method.spawn
//! [`output`]: struct.Command.html#method.output
//! [`stdout`]: Command::stdout
//! [`stdin`]: Command::stdin
//! [`stderr`]: Command::stderr
//!
//! [`Child`]: struct.Child.html
//! [`ChildStdin`]: struct.ChildStdin.html
//! [`ChildStdout`]: struct.ChildStdout.html
//! [`ChildStderr`]: struct.ChildStderr.html
//! [`Stdio`]: struct.Stdio.html
//!
//! [`stdout`]: struct.Command.html#method.stdout
//! [`stdin`]: struct.Command.html#method.stdin
//! [`stderr`]: struct.Command.html#method.stderr
//!
//! [`Write`]: ../io/trait.Write.html
//! [`Read`]: ../io/trait.Read.html
//! [`Write`]: io::Write
//! [`Read`]: io::Read

#![stable(feature = "process", since = "1.0.0")]

Expand Down Expand Up @@ -130,7 +120,7 @@ use crate::sys_common::{AsInner, AsInnerMut, FromInner, IntoInner};
/// run, even after the `Child` handle to the child process has gone out of
/// scope.
///
/// Calling [`wait`](#method.wait) (or other functions that wrap around it) will make
/// Calling [`wait`] (or other functions that wrap around it) will make
/// the parent process wait until the child has actually exited before
/// continuing.
///
Expand Down Expand Up @@ -162,9 +152,7 @@ use crate::sys_common::{AsInner, AsInnerMut, FromInner, IntoInner};
/// assert!(ecode.success());
/// ```
///
/// [`Command`]: struct.Command.html
/// [`Drop`]: ../../core/ops/trait.Drop.html
/// [`wait`]: #method.wait
/// [`wait`]: Child::wait
#[stable(feature = "process", since = "1.0.0")]
pub struct Child {
handle: imp::Process,
Expand Down Expand Up @@ -248,9 +236,8 @@ impl fmt::Debug for Child {
/// file handle will be closed. If the child process was blocked on input prior
/// to being dropped, it will become unblocked after dropping.
///
/// [`Child`]: struct.Child.html
/// [`stdin`]: struct.Child.html#structfield.stdin
/// [dropped]: ../ops/trait.Drop.html
/// [`stdin`]: Child::stdin
/// [dropped]: Drop
#[stable(feature = "process", since = "1.0.0")]
pub struct ChildStdin {
inner: AnonPipe,
Expand Down Expand Up @@ -307,9 +294,8 @@ impl fmt::Debug for ChildStdin {
/// When an instance of `ChildStdout` is [dropped], the `ChildStdout`'s
/// underlying file handle will be closed.
///
/// [`Child`]: struct.Child.html
/// [`stdout`]: struct.Child.html#structfield.stdout
/// [dropped]: ../ops/trait.Drop.html
/// [`stdout`]: Child::stdout
/// [dropped]: Drop
#[stable(feature = "process", since = "1.0.0")]
pub struct ChildStdout {
inner: AnonPipe,
Expand Down Expand Up @@ -368,9 +354,8 @@ impl fmt::Debug for ChildStdout {
/// When an instance of `ChildStderr` is [dropped], the `ChildStderr`'s
/// underlying file handle will be closed.
///
/// [`Child`]: struct.Child.html
/// [`stderr`]: struct.Child.html#structfield.stderr
/// [dropped]: ../ops/trait.Drop.html
/// [`stderr`]: Child::stderr
/// [dropped]: Drop
#[stable(feature = "process", since = "1.0.0")]
pub struct ChildStderr {
inner: AnonPipe,
Expand Down Expand Up @@ -543,7 +528,7 @@ impl Command {
///
/// To pass multiple arguments see [`args`].
///
/// [`args`]: #method.args
/// [`args`]: Command::args
///
/// # Examples
///
Expand All @@ -568,7 +553,7 @@ impl Command {
///
/// To pass a single argument see [`arg`].
///
/// [`arg`]: #method.arg
/// [`arg`]: Command::arg
///
/// # Examples
///
Expand Down Expand Up @@ -721,7 +706,7 @@ impl Command {
/// .expect("ls command failed to start");
/// ```
///
/// [`canonicalize`]: ../fs/fn.canonicalize.html
/// [`canonicalize`]: crate::fs::canonicalize
#[stable(feature = "process", since = "1.0.0")]
pub fn current_dir<P: AsRef<Path>>(&mut self, dir: P) -> &mut Command {
self.inner.cwd(dir.as_ref().as_ref());
Expand All @@ -733,8 +718,8 @@ impl Command {
/// Defaults to [`inherit`] when used with `spawn` or `status`, and
/// defaults to [`piped`] when used with `output`.
///
/// [`inherit`]: struct.Stdio.html#method.inherit
/// [`piped`]: struct.Stdio.html#method.piped
/// [`inherit`]: Stdio::inherit
/// [`piped`]: Stdio::piped
///
/// # Examples
///
Expand All @@ -759,8 +744,8 @@ impl Command {
/// Defaults to [`inherit`] when used with `spawn` or `status`, and
/// defaults to [`piped`] when used with `output`.
///
/// [`inherit`]: struct.Stdio.html#method.inherit
/// [`piped`]: struct.Stdio.html#method.piped
/// [`inherit`]: Stdio::inherit
/// [`piped`]: Stdio::piped
///
/// # Examples
///
Expand All @@ -785,8 +770,8 @@ impl Command {
/// Defaults to [`inherit`] when used with `spawn` or `status`, and
/// defaults to [`piped`] when used with `output`.
///
/// [`inherit`]: struct.Stdio.html#method.inherit
/// [`piped`]: struct.Stdio.html#method.piped
/// [`inherit`]: Stdio::inherit
/// [`piped`]: Stdio::piped
///
/// # Examples
///
Expand Down Expand Up @@ -914,10 +899,8 @@ impl AsInnerMut<imp::Command> for Command {
/// [`Command`], or the [`wait_with_output`] method of a [`Child`]
/// process.
///
/// [`Command`]: struct.Command.html
/// [`Child`]: struct.Child.html
/// [`output`]: struct.Command.html#method.output
/// [`wait_with_output`]: struct.Child.html#method.wait_with_output
/// [`output`]: Command::output
/// [`wait_with_output`]: Child::wait_with_output
#[derive(PartialEq, Eq, Clone)]
#[stable(feature = "process", since = "1.0.0")]
pub struct Output {
Expand Down Expand Up @@ -960,10 +943,9 @@ impl fmt::Debug for Output {
/// Describes what to do with a standard I/O stream for a child process when
/// passed to the [`stdin`], [`stdout`], and [`stderr`] methods of [`Command`].
///
/// [`stdin`]: struct.Command.html#method.stdin
/// [`stdout`]: struct.Command.html#method.stdout
/// [`stderr`]: struct.Command.html#method.stderr
/// [`Command`]: struct.Command.html
/// [`stdin`]: Command::stdin
/// [`stdout`]: Command::stdout
/// [`stderr`]: Command::stderr
#[stable(feature = "process", since = "1.0.0")]
pub struct Stdio(imp::Stdio);

Expand Down Expand Up @@ -1227,10 +1209,8 @@ impl From<fs::File> for Stdio {
/// status is exposed through the [`status`] method, or the [`wait`] method
/// of a [`Child`] process.
///
/// [`Command`]: struct.Command.html
/// [`Child`]: struct.Child.html
/// [`status`]: struct.Command.html#method.status
/// [`wait`]: struct.Child.html#method.wait
/// [`status`]: Command::status
/// [`wait`]: Child::wait
#[derive(PartialEq, Eq, Clone, Copy, Debug)]
#[stable(feature = "process", since = "1.0.0")]
pub struct ExitStatus(imp::ExitStatus);
Expand Down Expand Up @@ -1315,8 +1295,8 @@ impl fmt::Display for ExitStatus {
/// For the platform's canonical successful and unsuccessful codes, see
/// the [`SUCCESS`] and [`FAILURE`] associated items.
///
/// [`SUCCESS`]: #associatedconstant.SUCCESS
/// [`FAILURE`]: #associatedconstant.FAILURE
/// [`SUCCESS`]: ExitCode::SUCCESS
/// [`FAILURE`]: ExitCode::FAILURE
///
/// **Warning**: While various forms of this were discussed in [RFC #1937],
/// it was ultimately cut from that RFC, and thus this type is more subject
Expand Down Expand Up @@ -1370,9 +1350,9 @@ impl Child {
/// }
/// ```
///
/// [`ErrorKind`]: ../io/enum.ErrorKind.html
/// [`InvalidInput`]: ../io/enum.ErrorKind.html#variant.InvalidInput
/// [`Other`]: ../io/enum.ErrorKind.html#variant.Other
/// [`ErrorKind`]: io::ErrorKind
/// [`InvalidInput`]: io::ErrorKind::InvalidInput
/// [`Other`]: io::ErrorKind::Other
#[stable(feature = "process", since = "1.0.0")]
pub fn kill(&mut self) -> io::Result<()> {
self.handle.kill()
Expand Down Expand Up @@ -1637,8 +1617,7 @@ pub fn exit(code: i32) -> ! {
/// }
/// ```
///
/// [`panic!`]: ../../std/macro.panic.html
/// [panic hook]: ../../std/panic/fn.set_hook.html
/// [panic hook]: crate::panic::set_hook
#[stable(feature = "process_abort", since = "1.17.0")]
pub fn abort() -> ! {
crate::sys::abort_internal();
Expand Down