From a6ef99e9f43e70c36dc9744bc87374033b2dedba Mon Sep 17 00:00:00 2001 From: Corey Farwell Date: Fri, 15 Sep 2017 22:57:12 -0400 Subject: [PATCH] Indicate how ChildStd{in,out,err} FDs are closed. Fixes https://github.com/rust-lang/rust/issues/41452. --- src/libstd/process.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/libstd/process.rs b/src/libstd/process.rs index a3a7e91dd80..4dba9a4cb11 100644 --- a/src/libstd/process.rs +++ b/src/libstd/process.rs @@ -153,8 +153,12 @@ impl fmt::Debug for Child { /// /// This struct is used in the [`stdin`] field on [`Child`]. /// +/// When an instance of `ChildStdin` is [dropped], the `ChildStdin`'s underlying +/// file handle will be closed. +/// /// [`Child`]: struct.Child.html /// [`stdin`]: struct.Child.html#structfield.stdin +/// [dropped]: ../ops/trait.Drop.html #[stable(feature = "process", since = "1.0.0")] pub struct ChildStdin { inner: AnonPipe @@ -196,8 +200,12 @@ impl fmt::Debug for ChildStdin { /// /// This struct is used in the [`stdout`] field on [`Child`]. /// +/// 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 #[stable(feature = "process", since = "1.0.0")] pub struct ChildStdout { inner: AnonPipe @@ -239,8 +247,12 @@ impl fmt::Debug for ChildStdout { /// /// This struct is used in the [`stderr`] field on [`Child`]. /// +/// 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 #[stable(feature = "process", since = "1.0.0")] pub struct ChildStderr { inner: AnonPipe