Skip to content

Commit

Permalink
Mark std::process:Child as #[must_use]
Browse files Browse the repository at this point in the history
Simply dropping this is usually a bad idea, for the reasons
extensively discussed in the documentation.

Closes: rust-lang#70186
Signed-off-by: Ian Jackson <[email protected]>
  • Loading branch information
ijackson committed Jan 28, 2021
1 parent be40a3f commit 4921c37
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions library/std/src/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ use crate::sys_common::{AsInner, AsInnerMut, FromInner, IntoInner};
///
/// [`wait`]: Child::wait
#[stable(feature = "process", since = "1.0.0")]
#[must_use = "this Child should probably be `wait`ed, or `status` used instead of `spawn`"]
pub struct Child {
handle: imp::Process,

Expand Down

0 comments on commit 4921c37

Please sign in to comment.