Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

implement Send for process::Command on unix #47760

Merged
merged 3 commits into from
Jan 30, 2018
Merged

Conversation

little-dude
Copy link
Contributor

closes #47751

@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @Mark-Simulacrum (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@alexcrichton
Copy link
Member

Thanks! Since Command contains a whole bunch of fields (even trait objects!) perhaps we could implement Send manually for a specific field rather than the whole struct? That way we could catch if we accidentally introduce a bug into one of the other fields.

Also, could you be sure to add a test for this as well?

@kennytm kennytm added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 26, 2018
Implementing Send for a specific field rather than the whole struct is
safer: if a field is changed/modified and becomes non-Send, we can catch
it.
@little-dude
Copy link
Contributor Author

@alexcrichton thanks for reviewing! I added the test src/libstd/process.rs so that it does not only run for unix.

@alexcrichton
Copy link
Member

@bors: r+

THanks @little-dude!

@bors
Copy link
Contributor

bors commented Jan 26, 2018

📌 Commit 077d343 has been approved by alexcrichton

@alexcrichton
Copy link
Member

@bors: rollup

@cuviper cuviper added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 26, 2018
little-dude added a commit to little-dude/expect-rs that referenced this pull request Jan 28, 2018
This is an attempt to provide a sync api, which makes much more sense
for expect. The idea is to run the event loop in a separate thread so
that we can call `Future::wait()` in the client handle without
preventing the event loop from making progress.

Note that this currently rely on
rust-lang/rust#47760

Fwiw, running our own even loop is not considered good practice, but it
the approach reqwest has taken too, so I guess it's not that bad.
kennytm added a commit to kennytm/rust that referenced this pull request Jan 29, 2018
implement Send for process::Command on unix

closes rust-lang#47751
kennytm added a commit to kennytm/rust that referenced this pull request Jan 30, 2018
implement Send for process::Command on unix

closes rust-lang#47751
bors added a commit that referenced this pull request Jan 30, 2018
Rollup of 12 pull requests

- Successful merges: #47515, #47603, #47718, #47732, #47760, #47780, #47822, #47826, #47836, #47839, #47853, #47855
- Failed merges:
@bors bors merged commit 077d343 into rust-lang:master Jan 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Could process::Command implement Send ?
7 participants