Skip to content
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 implementations for I/O safety traits unconditionally #244

Merged
merged 2 commits into from Jul 5, 2023

Conversation

LingMan
Copy link
Contributor

@LingMan LingMan commented Jul 4, 2023

The first commit is a cleanup removing the build script. Until now it gated the implementation of AsFd / AsHandle on the existence of these traits in std. They have been stabilized with Rust 1.63 which will soon be this crate's MSRV.

I'll rebase this PR once that has landed. Until then CI will obviously fail.

The second commit enables AsFd/AsRawFd implementations on wasi, since std provides the traits there as well.

Copy link
Owner

@Stebalien Stebalien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Stebalien
Copy link
Owner

(I'll let you rebase then merge when the tests pass)

These traits have been stabilized with Rust 1.63. Since that is now our MSRV, we can drop the
`build.rs` as well as the `autocfg` build dependency.
While at it, I've also added a few `use` statements to make the implemenations more readable.
@LingMan LingMan force-pushed the iosafety branch 3 times, most recently from 682f52a to 8e9136e Compare July 5, 2023 19:40
@LingMan
Copy link
Contributor Author

LingMan commented Jul 5, 2023

Ok, slight annoyance with the import paths:
AsFd and friends exist since 1.63, but they were located at std::os::{unix,wasi}::io until 1.66. Now they are also exported from std::os::fd, which is the only documented path.

`std` provides these traits on wasi, so we should probably do so as well.
Copy link
Owner

@Stebalien Stebalien left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@Stebalien Stebalien merged commit da36cd5 into Stebalien:master Jul 5, 2023
12 checks passed
@LingMan LingMan deleted the iosafety branch July 5, 2023 21:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants