-
Notifications
You must be signed in to change notification settings - Fork 12
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
Implement AsFd
for &T
and &mut T
.
#18
Merged
Merged
Conversation
This file contains 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
This ports rust-lang/rust#93888 to io-lifetimes.
The tests using std's types and traits tests depend on #93888 landing in nightly. |
sunfishcode
added a commit
to bytecodealliance/rustix
that referenced
this pull request
Feb 16, 2022
With rust-lang/rust#93888 now in nightly, and sunfishcode/io-lifetimes#18 now in io-lifetimes 0.5.2, we can now simplify the `AsFd` pattern from `fn foo<Fd: AsFd>(fd: &Fd)` to `fn foo<Fd: AsFd>(fd: Fd)`, without the `&`. This also follows the emerging convention in std, as seen in the new [`fchown`] function. This means that users can now pass `BorrowedFd` values directly to functions that expect `AsFd` arguments, without having to write an extra `&` when passing them. [`fchown`]: https://doc.rust-lang.org/nightly/std/os/unix/fs/fn.fchown.html
sunfishcode
added a commit
to bytecodealliance/rustix
that referenced
this pull request
Feb 16, 2022
With rust-lang/rust#93888 now in nightly, and sunfishcode/io-lifetimes#18 now in io-lifetimes 0.5.2, we can now simplify the `AsFd` pattern from `fn foo<Fd: AsFd>(fd: &Fd)` to `fn foo<Fd: AsFd>(fd: Fd)`, without the `&`. This also follows the emerging convention in std, as seen in the new [`fchown`] function. This means that users can now pass `BorrowedFd` values directly to functions that expect `AsFd` arguments, without having to write an extra `&` when passing them. [`fchown`]: https://doc.rust-lang.org/nightly/std/os/unix/fs/fn.fchown.html
sunfishcode
added a commit
to bytecodealliance/rustix
that referenced
this pull request
Feb 17, 2022
With rust-lang/rust#93888 now in nightly, and sunfishcode/io-lifetimes#18 now in io-lifetimes 0.5.2, we can now simplify the `AsFd` pattern from `fn foo<Fd: AsFd>(fd: &Fd)` to `fn foo<Fd: AsFd>(fd: Fd)`, without the `&`. This also follows the emerging convention in std, as seen in the new [`fchown`] function. This means that users can now pass `BorrowedFd` values directly to functions that expect `AsFd` arguments, without having to write an extra `&` when passing them. [`fchown`]: https://doc.rust-lang.org/nightly/std/os/unix/fs/fn.fchown.html
sunfishcode
added a commit
to sunfishcode/io-extras
that referenced
this pull request
Feb 17, 2022
Update to io-lifetimes 0.5.2 and `impl AsFd for &T` support added in rust-lang/rust#93888 and sunfishcode/io-lifetimes#18.
sunfishcode
added a commit
to sunfishcode/io-extras
that referenced
this pull request
Feb 17, 2022
Update to io-lifetimes 0.5.2 and `impl AsFd for &T` support added in rust-lang/rust#93888 and sunfishcode/io-lifetimes#18.
sunfishcode
added a commit
to sunfishcode/io-extras
that referenced
this pull request
Mar 15, 2022
Update to io-lifetimes 0.5.2 and `impl AsFd for &T` support added in rust-lang/rust#93888 and sunfishcode/io-lifetimes#18.
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.
This ports rust-lang/rust#93888 to io-lifetimes.