impl IoSafe for std::io::PipeReader & std::io::PipeWriter#237
Merged
taiki-e merged 1 commit intosmol-rs:masterfrom Aug 5, 2025
Merged
impl IoSafe for std::io::PipeReader & std::io::PipeWriter#237taiki-e merged 1 commit intosmol-rs:masterfrom
taiki-e merged 1 commit intosmol-rs:masterfrom
Conversation
Contributor
Author
|
Looks like This means we have two |
936c781 to
b26d0cc
Compare
Contributor
Author
and thanks for the review! 😄 |
notgull
reviewed
Aug 5, 2025
build.rs
Outdated
Comment on lines
+10
to
+12
| // emit expected config settings; may be replaced with | ||
| // autocfg::emit_possibility if we update to autocfg>=1.5 | ||
| println!("cargo:rustc-check-cfg=cfg(async_io_no_pipe)"); |
Member
There was a problem hiding this comment.
This can be moved to Cargo.toml, right?
Contributor
Author
There was a problem hiding this comment.
Yep, I am happy to implement it there if preferred.
Contributor
Author
There was a problem hiding this comment.
OK, now it's in Cargo.toml's [lints.rust].
It would be handy to have async wrappers for the pipe types (from std::io::pipe()), so impl IoSafe for both. The pipe types were introduced in 1.87, but the MSRV for async-io appears to be 1.63 currently. So, protect the impls with cfg()s and use autocfg to detect the type availbility, similar to what was done in a20076f ("Implement I/O-safe traits (smol-rs#84)") Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
taiki-e
approved these changes
Aug 5, 2025
Collaborator
|
Published in 2.6.0. |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
It would be handy to have async wrappers for the pipe types (from std::io::pipe()), so impl IoSafe for both.
The pipe types were introduced in 1.87, but the MSRV for async-io appears to be 1.63 currently. So, protect the impls with a cfg(has_pipe), and use autocfg to set has_pipe, like was done in a20076f ("Implement I/O-safe traits (#84)")