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

Stdio::makes_pipe #97150

Merged
merged 1 commit into from
Jun 20, 2022
Merged

Stdio::makes_pipe #97150

merged 1 commit into from
Jun 20, 2022

Conversation

ChrisDenton
Copy link
Contributor

@ChrisDenton ChrisDenton commented May 18, 2022

Wrappers around std::process::Command may want to be able to override pipe creation. However, std::process::Stdio is opaque so there's no way to tell if Command was told to create new pipes or not.

This is in some ways a more generic (and cross-platform) alternative to #97149. However, unlike that feature, this comes with the price of the user needing to actually create their own pipes rather than reusing the std one. So I think it stands (or not) on its own.

Example

#![feature(stdio_makes_pipe)]
use std::process::Stdio;

let io = Stdio::piped();
assert_eq!(io.makes_pipe(), true);

@ChrisDenton ChrisDenton added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. A-process Area: std::process and std::env labels May 18, 2022
@rust-highfive
Copy link
Collaborator

Hey! It looks like you've submitted a new PR for the library teams!

If this PR contains changes to any rust-lang/rust public library APIs then please comment with r? rust-lang/libs-api @rustbot label +T-libs-api -T-libs to request review from a libs-api team reviewer. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.

Examples of T-libs-api changes:

  • Stabilizing library features
  • Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
  • Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
  • Changing public documentation in ways that create new stability guarantees
  • Changing observable runtime behavior of library APIs

@rust-highfive
Copy link
Collaborator

r? @kennytm

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 18, 2022
@ChrisDenton
Copy link
Contributor Author

r? rust-lang/libs-api

@rust-highfive rust-highfive assigned m-ou-se and unassigned kennytm May 18, 2022
@the8472
Copy link
Member

the8472 commented May 19, 2022

Shouldn't it be makes_pipe (interrogative) rather than make_pipe (imperative)?

@ChrisDenton ChrisDenton changed the title Stdio::make_pipe Stdio::makes_pipe May 19, 2022
@ChrisDenton
Copy link
Contributor Author

Good point, changed!

@m-ou-se
Copy link
Member

m-ou-se commented Jun 20, 2022

Looks good to me, other than some potential bikeshedding on the name. (is_piped() to match piped()?)

r=me after opening a tracking issue.

@ChrisDenton
Copy link
Contributor Author

@bors r=m-ou-se rollup

@bors
Copy link
Contributor

bors commented Jun 20, 2022

📌 Commit 8b93147 has been approved by m-ou-se

@bors bors 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-review Status: Awaiting review from the assignee but also interested parties. labels Jun 20, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 20, 2022
Rollup of 8 pull requests

Successful merges:

 - rust-lang#93080 (Implement `core::slice::IterMut::as_mut_slice` and `impl<T> AsMut<[T]> for IterMut<'_, T>`)
 - rust-lang#94855 (Panic when advance_slices()'ing too far and update docs.)
 - rust-lang#96609 (Add `{Arc, Rc}::downcast_unchecked`)
 - rust-lang#96719 (Fix the generator example for `pin!()`)
 - rust-lang#97149 (Windows: `CommandExt::async_pipes`)
 - rust-lang#97150 (`Stdio::makes_pipe`)
 - rust-lang#97837 (Document Rust's stance on `/proc/self/mem`)
 - rust-lang#98159 (Include ForeignItem when visiting types for WF check)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 2807f28 into rust-lang:master Jun 20, 2022
@rustbot rustbot added this to the 1.63.0 milestone Jun 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-process Area: std::process and std::env 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.

None yet

7 participants