Consider adding #[must_use] to std::process::Child #70186
Labels
A-process
Area: `std::process` and `std::env`
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
I fixed a bug that was caused by not calling
.wait()
on astd::process::Child
. See the issue for the details. I'm not exactly sure how the bug manifested itself, but I noticed that not waiting for the child process whose stdin or stdout is inherited from the parent process can lead to weird behavior.That's why I suggest to add
#[must_use = "this Child may still be attached to its parent process's stdin/stdout and must be handled"]
tostd::process::Child
. Currently I can't think of a reason why someone would not use aChild
and that's I think the compiler warnings on that will prevent more headaches than they will cause.The text was updated successfully, but these errors were encountered: