Skip to content

Commit 831ff77

Browse files
committed
implement Send for process::Command on unix
closes #47751
1 parent 9fd7da9 commit 831ff77

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/libstd/sys/unix/process/process_common.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@ pub enum Stdio {
8787
Fd(FileDesc),
8888
}
8989

90+
// Command is not Send by default due to the Command.argv field containing a raw pointers. However
91+
// it is safe to implement Send, because anyway, these pointers point to memory owned by the
92+
// Command.args field.
93+
unsafe impl Send for Command {}
94+
9095
impl Command {
9196
pub fn new(program: &OsStr) -> Command {
9297
let mut saw_nul = false;

0 commit comments

Comments
 (0)