-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Converted all platform-specific stdin/stdout/stderr implementations to use io:: traits #73495
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
r? @sfackler (rust_highfive has picked a reviewer for you, use r? to override) |
rust-highfive
added
the
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
label
Jun 19, 2020
dtolnay
added
the
T-libs
Relevant to the library team, which will review and decide on the PR/issue.
label
Jun 19, 2020
hellow554
reviewed
Jun 19, 2020
There are some modifications from |
sfackler
reviewed
Jun 19, 2020
I'm at 99.9% sure. Here are the checks I did:
|
@bors r+ |
📌 Commit 0094f44 has been approved by |
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 19, 2020
Manishearth
added a commit
to Manishearth/rust
that referenced
this pull request
Jun 20, 2020
Converted all platform-specific stdin/stdout/stderr implementations to use io:: traits Currently, some of the platform-specific standard streams (`src/libstd/sys/*/stdio.rs`) manually implement parts of the `io::Write` interface directly as methods on the struct, rather than by actually implementing the trait. There doesn't seem to be any reason for this, other than an unused advantage of `fn write(&self, ...)` instead of `fn write(&mut self, ...)`. Unfortunately, this means that those implementations don't have the default-implemented io methods, like `read_exact` and `write_all`. This caused rust-lang#72705, which adds forwarding methods to the user-facing standard stream implementations, to fail to compile on those platforms. This change converts *all* such standard stream structs to use the standard library traits. This change should not cause any breakages, because the changed types are not publicly exported, and in fact are only ever used in `src/libstd/io/stdio.rs`.
Manishearth
added a commit
to Manishearth/rust
that referenced
this pull request
Jun 20, 2020
Converted all platform-specific stdin/stdout/stderr implementations to use io:: traits Currently, some of the platform-specific standard streams (`src/libstd/sys/*/stdio.rs`) manually implement parts of the `io::Write` interface directly as methods on the struct, rather than by actually implementing the trait. There doesn't seem to be any reason for this, other than an unused advantage of `fn write(&self, ...)` instead of `fn write(&mut self, ...)`. Unfortunately, this means that those implementations don't have the default-implemented io methods, like `read_exact` and `write_all`. This caused rust-lang#72705, which adds forwarding methods to the user-facing standard stream implementations, to fail to compile on those platforms. This change converts *all* such standard stream structs to use the standard library traits. This change should not cause any breakages, because the changed types are not publicly exported, and in fact are only ever used in `src/libstd/io/stdio.rs`.
Manishearth
added a commit
to Manishearth/rust
that referenced
this pull request
Jun 21, 2020
Converted all platform-specific stdin/stdout/stderr implementations to use io:: traits Currently, some of the platform-specific standard streams (`src/libstd/sys/*/stdio.rs`) manually implement parts of the `io::Write` interface directly as methods on the struct, rather than by actually implementing the trait. There doesn't seem to be any reason for this, other than an unused advantage of `fn write(&self, ...)` instead of `fn write(&mut self, ...)`. Unfortunately, this means that those implementations don't have the default-implemented io methods, like `read_exact` and `write_all`. This caused rust-lang#72705, which adds forwarding methods to the user-facing standard stream implementations, to fail to compile on those platforms. This change converts *all* such standard stream structs to use the standard library traits. This change should not cause any breakages, because the changed types are not publicly exported, and in fact are only ever used in `src/libstd/io/stdio.rs`.
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jun 23, 2020
Rollup of 7 pull requests Successful merges: - rust-lang#71756 (add Windows system error codes that should map to io::ErrorKind::TimedOut) - rust-lang#73495 (Converted all platform-specific stdin/stdout/stderr implementations to use io:: traits) - rust-lang#73575 (Fix typo in error_codes doc) - rust-lang#73578 (Make is_freeze and is_copy_modulo_regions take TyCtxtAt) - rust-lang#73586 (switch_ty is redundant) - rust-lang#73600 (Fix spurious 'value moved here in previous iteration of loop' messages) - rust-lang#73610 (Clean up E0699 explanation) Failed merges: r? @ghost
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
Relevant to the library team, which will review and decide on the PR/issue.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, some of the platform-specific standard streams (
src/libstd/sys/*/stdio.rs
) manually implement parts of theio::Write
interface directly as methods on the struct, rather than by actually implementing the trait. There doesn't seem to be any reason for this, other than an unused advantage offn write(&self, ...)
instead offn write(&mut self, ...)
.Unfortunately, this means that those implementations don't have the default-implemented io methods, like
read_exact
andwrite_all
. This caused #72705, which adds forwarding methods to the user-facing standard stream implementations, to fail to compile on those platforms.This change converts all such standard stream structs to use the standard library traits. This change should not cause any breakages, because the changed types are not publicly exported, and in fact are only ever used in
src/libstd/io/stdio.rs
.