diff options
| author | Corentin Henry <corentinhenry@gmail.com> | 2018-01-25 15:08:48 -0800 |
|---|---|---|
| committer | Corentin Henry <corentinhenry@gmail.com> | 2018-01-25 15:14:38 -0800 |
| commit | 831ff775703eb5126f741fc3be1cf829ec060011 (patch) | |
| tree | e8a8fe13ba42ea3cb0db375fc475927af66ca5c2 /src/libstd | |
| parent | 9fd7da904b46ff7aa78c2e2cc1986c4975aeccc6 (diff) | |
| download | rust-831ff775703eb5126f741fc3be1cf829ec060011.tar.gz rust-831ff775703eb5126f741fc3be1cf829ec060011.zip | |
implement Send for process::Command on unix
closes https://github.com/rust-lang/rust/issues/47751
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/sys/unix/process/process_common.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libstd/sys/unix/process/process_common.rs b/src/libstd/sys/unix/process/process_common.rs index c53bcdbf8e3..b09fc36dee0 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; |
