Skip to content

std: Implement lowering and raising for process IO #25494

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

Merged
merged 1 commit into from
May 29, 2015

Conversation

alexcrichton
Copy link
Member

This commit implements a number of standard traits for the standard library's
process I/O handles. The FromRaw{Fd,Handle} traits are now implemented for the
Stdio type and the AsRaw{Fd,Handle} traits are now implemented for the
Child{Stdout,Stdin,Stderr} types.

The stability markers for these implementations mention that they are stable for
1.1 as I will nominate this commit for cherry-picking to beta.

@alexcrichton
Copy link
Member Author

r? @aturon

@rust-highfive rust-highfive assigned aturon and unassigned brson May 16, 2015
@rust-highfive
Copy link
Contributor

r? @brson

(rust_highfive has picked a reviewer for you, use r? to override)

This commit implements a number of standard traits for the standard library's
process I/O handles. The `FromRaw{Fd,Handle}` traits are now implemented for the
`Stdio` type and the `AsRaw{Fd,Handle}` traits are now implemented for the
`Child{Stdout,Stdin,Stderr}` types. Additionally this implements the
`AsRawHandle` trait for `Child` on Windows.

The stability markers for these implementations mention that they are stable for
1.1 as I will nominate this commit for cherry-picking to beta.
@alexcrichton alexcrichton force-pushed the stdio-from-raw branch 4 times, most recently from b3db491 to 3dd3450 Compare May 16, 2015 18:20
@alexcrichton alexcrichton added beta-nominated Nominated for backporting to the compiler in the beta channel. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels May 16, 2015
@alexcrichton
Copy link
Member Author

ping r? @aturon

/// Note that this function **does not** take ownership of the file
/// descriptor provided and it will **not** be closed when `Stdio` goes out
/// of scope. As a result this method is unsafe because due to the lack of
/// knowledge about the lifetime of the provided file descriptor, this could
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel slightly uneasy about this comment, as it directly contradicts the documentation for the trait.

It would be good to be more crisp about the story here.

@aturon
Copy link
Member

aturon commented May 29, 2015

@bors: r+

@bors
Copy link
Collaborator

bors commented May 29, 2015

📌 Commit 3dd3450 has been approved by aturon

@aturon
Copy link
Member

aturon commented May 29, 2015

(I'm assuming we still intend to backport; if not, feel free to r- and update stability markers.)

@bors
Copy link
Collaborator

bors commented May 29, 2015

⌛ Testing commit 3dd3450 with merge 996fb8d...

bors added a commit that referenced this pull request May 29, 2015
This commit implements a number of standard traits for the standard library's
process I/O handles. The `FromRaw{Fd,Handle}` traits are now implemented for the
`Stdio` type and the `AsRaw{Fd,Handle}` traits are now implemented for the
`Child{Stdout,Stdin,Stderr}` types.

The stability markers for these implementations mention that they are stable for
1.1 as I will nominate this commit for cherry-picking to beta.
@alexcrichton
Copy link
Member Author

triage: not accepted for beta

@alexcrichton alexcrichton deleted the stdio-from-raw branch June 9, 2015 22:34
@alexcrichton alexcrichton removed the beta-nominated Nominated for backporting to the compiler in the beta channel. label Jun 9, 2015
bors added a commit that referenced this pull request Jun 11, 2015
…=brson

* Slate these features to be stable in 1.2 instead of 1.1 (not being backported)
* Have the `FromRawFd` implementations follow the contract of the `FromRawFd`
  trait by taking ownership of the primitive specified.
* Refactor the implementations slightly to remove the `unreachable!` blocks as
  well as separating the stdio representation of `std::process` from
  `std::sys::process`.

cc #25494
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

5 participants