-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Remove unused Maybe
wrapper around raw standard streams
#75772
Conversation
Raw standard streams constructors are infallible. Remove unnecessary result type.
Raw standard streams are always available. Remove unused wrapper type that was supposed to be responsible for handling their absence.
r? @dtolnay (rust_highfive has picked a reviewer for you, use r? to override) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, this is great. Two minor comments below.
@@ -50,8 +50,9 @@ struct StderrRaw(stdio::Stderr); | |||
/// handles is **not** available to raw handles returned from this function. | |||
/// | |||
/// The returned handle has no external synchronization or buffering. | |||
fn stdin_raw() -> io::Result<StdinRaw> { | |||
stdio::Stdin::new().map(StdinRaw) | |||
#[unstable(feature = "libstd_sys_internals", issue = "none")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All these stability attributes should be unnecessary, since the functions are private.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The windows stdio implementation has an unstable
attribute. The stable /
unstable boundary cannot be crossed within const functions (although I am not
sure about exact rules there), so I had to marked those as unstable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah that's too bad. I filed #75794 to follow up separately.
self.0.read_to_string(buf) | ||
} | ||
|
||
fn read_exact(&mut self, buf: &mut [u8]) -> io::Result<()> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is read_exact removed here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is convenient to use default implementation, which does the right thing
here. In contrast to say handle_ebadf
which wouldn't.
I can delegate it directly to the inner reader if you prefer.
@bors r+ |
📌 Commit 78e0946 has been approved by |
☀️ Test successful - checks-actions, checks-azure |
Your PR failed (pretty log, raw log). Through arcane magic we have determined that the following fragments from the build log may contain information about the problem. Click to expand the log.
I'm a bot! I can only do what humans tell me to, so if this was not helpful or you have suggestions for improvements, please ping or otherwise contact |
cargo checked with:
Note: Last target doesn't compile currently.