Safety docs about std::process::Child
going out of scope
There is no `Drop` implemented for `Child`, so if it goes out of scope in Rust-land and gets deallocated, the child process will continue to exist and execute. If users want a guarantee that the process has finished running and exited they must manually use `kill`, `wait`, or `wait_with_output`. Fixes #31289.
This commit is contained in:
parent
9041b93058
commit
cee1695e08
@ -47,6 +47,14 @@
|
||||
///
|
||||
/// assert!(ecode.success());
|
||||
/// ```
|
||||
///
|
||||
/// # Safety
|
||||
///
|
||||
/// Take note that there is no implementation of
|
||||
/// [`Drop`](../../core/ops/trait.Drop.html) for child processes, so if you
|
||||
/// not ensure the `Child` has exited (through `kill`, `wait`, or
|
||||
/// `wait_with_output`) then it will continue to run even after the `Child`
|
||||
/// handle to it has gone out of scope.
|
||||
#[stable(feature = "process", since = "1.0.0")]
|
||||
pub struct Child {
|
||||
handle: imp::Process,
|
||||
|
Loading…
Reference in New Issue
Block a user