File tree 3 files changed +11
-7
lines changed
3 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -2105,8 +2105,8 @@ mod tests {
2105
2105
}
2106
2106
2107
2107
#[ 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 ( "" ) )
2111
2111
}
2112
2112
}
Original file line number Diff line number Diff line change @@ -86,11 +86,13 @@ pub struct Command {
86
86
stderr : Option < Stdio > ,
87
87
}
88
88
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`
90
90
struct Argv ( Vec < * const c_char > ) ;
91
91
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`
93
94
unsafe impl Send for Argv { }
95
+ unsafe impl Sync for Argv { }
94
96
95
97
// passed back to std::process with the pipes connected to the child, if any
96
98
// were requested
Original file line number Diff line number Diff line change @@ -49,11 +49,13 @@ pub struct Command {
49
49
stderr : Option < Stdio > ,
50
50
}
51
51
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 `
53
53
struct Argv ( Vec < * const c_char > ) ;
54
54
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`
56
57
unsafe impl Send for Argv { }
58
+ unsafe impl Sync for Argv { }
57
59
58
60
// passed back to std::process with the pipes connected to the child, if any
59
61
// were requested
You can’t perform that action at this time.
0 commit comments