You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
std::process::Command is currently Send, but not Sync. While Sync probably isn't super useful for Command itself, it does mean that any type that wraps a process::Commandalso isn't Sync even if it might be useful on that type.
Command currently has a manual impl Send following #47760 (issue #47751), though from the discussion on users.r-l.o, it sounds like a manual impl Sync would also be sound. @cuviper not sure if that still holds?
If it does, this seems like a worthwhile impl to add, simply for the auto-trait implications.
To give one example of where this crops up: tokio::process::Command currently isn't Sync because std::process::Command isn't Sync. This also means that any async fn that usestokio::process::Command across an await point is not Sync. Again, the ramifications of that probably aren't too severe (how important is it that a Future is Sync?), but it does lead to some annoyance when trying to use that future with libraries that just stick Send + Sync bounds wherever to get rid of compiler errors 😅
Activity
jonhoo commentedon May 20, 2020
To give one example of where this crops up:
tokio::process::Commandcurrently isn'tSyncbecausestd::process::Commandisn'tSync. This also means that anyasync fnthat usestokio::process::Commandacross an await point is notSync. Again, the ramifications of that probably aren't too severe (how important is it that aFutureisSync?), but it does lead to some annoyance when trying to use that future with libraries that just stickSend + Syncbounds wherever to get rid of compiler errors 😅cuviper commentedon May 20, 2020
As with
Send, I think it's just theargvthat isn'tSync, but that should be fine to add.Rollup merge of rust-lang#72472 - LeSeulArtichaut:sync-command, r=dto…
Auto merge of rust-lang#72472 - LeSeulArtichaut:sync-command, r=dtolnay