From 831ff775703eb5126f741fc3be1cf829ec060011 Mon Sep 17 00:00:00 2001 From: Corentin Henry Date: Thu, 25 Jan 2018 15:08:48 -0800 Subject: [PATCH] implement Send for process::Command on unix closes https://github.com/rust-lang/rust/issues/47751 --- src/libstd/sys/unix/process/process_common.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libstd/sys/unix/process/process_common.rs b/src/libstd/sys/unix/process/process_common.rs index c53bcdbf8e36..b09fc36dee0b 100644 --- a/src/libstd/sys/unix/process/process_common.rs +++ b/src/libstd/sys/unix/process/process_common.rs @@ -87,6 +87,11 @@ pub enum Stdio { Fd(FileDesc), } +// Command is not Send by default due to the Command.argv field containing a raw pointers. However +// it is safe to implement Send, because anyway, these pointers point to memory owned by the +// Command.args field. +unsafe impl Send for Command {} + impl Command { pub fn new(program: &OsStr) -> Command { let mut saw_nul = false;