-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Provide optional Read
/Write
methods for stdio
#136769
base: master
Are you sure you want to change the base?
Provide optional Read
/Write
methods for stdio
#136769
Conversation
r? @Noratrieb rustbot has assigned @Noratrieb. Use |
This comment has been minimized.
This comment has been minimized.
6d101c2
to
3deb1ce
Compare
r? joboet |
Read
/Write
method for stdioRead
/Write
methods for stdio
f51bb4e
to
118bb74
Compare
I dropped a few commits from this PR:
|
Since this touches a lot of targets, I'm going to split this into multiple PRs for more target-focused review, once #136780 goes through the merge queue. |
That'd be great, thank you! Especially the SGX stuff would be much simpler to review as a dedicated PR. |
118bb74
to
ade071b
Compare
36b01f3
to
46167f7
Compare
46167f7
to
70afdf2
Compare
That being said, I copy the optional I/O methods to |
@rustbot label -O-hermit -O-SGX -O-solid -O-unix -O-wasi -O-wasm -O-windows |
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.
Just some cosmetic suggestions:
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.
I think making Stderr
an alias to Stdin
in some of the other modules is a clever idea. Perhaps you could do the same 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.
Sure, I can do that. I think the only downside to these aliases is that Stderr
is then misnamed as Stdout
in stack traces.
Match what `std::io::Empty` does, since it is very similar.
This seems to be the pattern for newer pal stdio types.
70afdf2
to
46e3e46
Compare
Override more of the default methods for
io::Read
andio::Write
for stdio types, when efficient to do so, and deduplicate unsupported types.Tracked in #136756.