Skip to content

Commit 4921c37

Browse files
committed
Mark std::process:Child as #[must_use]
Simply dropping this is usually a bad idea, for the reasons extensively discussed in the documentation. Closes: #70186 Signed-off-by: Ian Jackson <[email protected]>
1 parent be40a3f commit 4921c37

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

library/std/src/process.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ use crate::sys_common::{AsInner, AsInnerMut, FromInner, IntoInner};
170170
///
171171
/// [`wait`]: Child::wait
172172
#[stable(feature = "process", since = "1.0.0")]
173+
#[must_use = "this Child should probably be `wait`ed, or `status` used instead of `spawn`"]
173174
pub struct Child {
174175
handle: imp::Process,
175176

0 commit comments

Comments
 (0)