From 4921c370cf2ec294fecdf2b2a5473cd7a3766915 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 27 Jan 2021 17:24:09 +0000 Subject: [PATCH] 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 --- library/std/src/process.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/library/std/src/process.rs b/library/std/src/process.rs index 06f7d39284246..6dec72a949fc2 100644 --- a/library/std/src/process.rs +++ b/library/std/src/process.rs @@ -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,