File tree Expand file tree Collapse file tree 3 files changed +11
-7
lines changed Expand file tree Collapse file tree 3 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -2105,8 +2105,8 @@ mod tests {
21052105 }
21062106
21072107 #[ test]
2108- fn test_command_implements_send ( ) {
2109- fn take_send_type < T : Send > ( _: T ) { }
2110- take_send_type ( Command :: new ( "" ) )
2108+ fn test_command_implements_send_sync ( ) {
2109+ fn take_send_sync_type < T : Send + Sync > ( _: T ) { }
2110+ take_send_sync_type ( Command :: new ( "" ) )
21112111 }
21122112}
Original file line number Diff line number Diff line change @@ -86,11 +86,13 @@ pub struct Command {
8686 stderr : Option < Stdio > ,
8787}
8888
89- // Create a new type for argv, so that we can make it `Send`
89+ // Create a new type for argv, so that we can make it `Send` and `Sync`
9090struct Argv ( Vec < * const c_char > ) ;
9191
92- // It is safe to make Argv Send, because it contains pointers to memory owned by `Command.args`
92+ // It is safe to make `Argv` `Send` and `Sync`, because it contains
93+ // pointers to memory owned by `Command.args`
9394unsafe impl Send for Argv { }
95+ unsafe impl Sync for Argv { }
9496
9597// passed back to std::process with the pipes connected to the child, if any
9698// were requested
Original file line number Diff line number Diff line change @@ -49,11 +49,13 @@ pub struct Command {
4949 stderr : Option < Stdio > ,
5050}
5151
52- // Create a new type for argv , so that we can make it `Send`
52+ // Create a new type for `Argv` , so that we can make it `Send` and `Sync `
5353struct Argv ( Vec < * const c_char > ) ;
5454
55- // It is safe to make Argv Send, because it contains pointers to memory owned by `Command.args`
55+ // It is safe to make `Argv` `Send` and `Sync`, because it contains
56+ // pointers to memory owned by `Command.args`
5657unsafe impl Send for Argv { }
58+ unsafe impl Sync for Argv { }
5759
5860// passed back to std::process with the pipes connected to the child, if any
5961// were requested
You can’t perform that action at this time.
0 commit comments