-
Notifications
You must be signed in to change notification settings - Fork 75
impl IoSafe for std::io::PipeReader & std::io::PipeWriter #237
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
Conversation
Looks like This means we have two |
936c781
to
b26d0cc
Compare
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!
and thanks for the review! 😄 |
build.rs
Outdated
// 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)"); |
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.
This can be moved to Cargo.toml
, right?
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.
Yep, I am happy to implement it there if preferred.
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.
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 <[email protected]>
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!
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)")