-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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
Use HandleOrNull
and HandleOrInvalid
in the Windows FFI bindings.
#94572
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
Use the new `HandleOrNull` and `HandleOrInvalid` types that were introduced as part of [I/O safety] in a few functions in the Windows FFI bindings. This factors out an `unsafe` block and two `unsafe` function calls in the Windows implementation code. And, it helps test `HandleOrNull` and `HandleOrInvalid`, which indeed turned up a bug: `OwnedHandle` also needs to be `#[repr(transparent)]`, as it's used inside of `HandleOrNull` and `HandleOrInvalid` which are also `#[repr(transparent)]`. [I/O safety]: rust-lang#87074
rust-highfive
added
the
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
label
Mar 3, 2022
@bors r+ |
📌 Commit 3560649 has been approved by |
bors
added
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Mar 4, 2022
Dylan-DPC
added a commit
to Dylan-DPC/rust
that referenced
this pull request
Mar 4, 2022
…r=joshtriplett Use `HandleOrNull` and `HandleOrInvalid` in the Windows FFI bindings. Use the new `HandleOrNull` and `HandleOrInvalid` types that were introduced as part of [I/O safety] in a few functions in the Windows FFI bindings. This factors out an `unsafe` block and two `unsafe` function calls in the Windows implementation code. And, it helps test `HandleOrNull` and `HandleOrInvalid`, and indeed, it turned up a bug: `OwnedHandle` also needs to be `#[repr(transparent)]`, as it's used inside of `HandleOrNull` and `HandleOrInvalid` which are also `#[repr(transparent)]`. r? `@joshtriplett` [I/O safety]: rust-lang#87074
sunfishcode
added a commit
to sunfishcode/io-lifetimes
that referenced
this pull request
Mar 4, 2022
This corresponds to rust-lang/rust#94572, which was recently approved. Also, fix a warning about a doc comment on an extern block.
sunfishcode
added a commit
to sunfishcode/io-lifetimes
that referenced
this pull request
Mar 4, 2022
This corresponds to rust-lang/rust#94572, which was recently approved. Also, fix a warning about a doc comment on an extern block.
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Mar 4, 2022
Rollup of 10 pull requests Successful merges: - rust-lang#88805 (Clarification of default socket flags) - rust-lang#93418 (rustdoc & doc: no `shortcut` for `rel="icon"`) - rust-lang#93913 (Remove the everybody loops pass) - rust-lang#93965 (Make regular stdio lock() return 'static handles) - rust-lang#94339 (ARM: Only allow using d16-d31 with asm! when supported by the target) - rust-lang#94404 (Make Ord and PartialOrd opt-out in `newtype_index`) - rust-lang#94466 (bootstrap: correct reading of flags for llvm) - rust-lang#94572 (Use `HandleOrNull` and `HandleOrInvalid` in the Windows FFI bindings.) - rust-lang#94575 (CTFE SwitchInt: update comment) - rust-lang#94582 (Fix a bug in `x.py fmt` that prevents some files being formatted.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
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.
Use the new
HandleOrNull
andHandleOrInvalid
types that were introducedas part of I/O safety in a few functions in the Windows FFI bindings.
This factors out an
unsafe
block and twounsafe
function calls in theWindows implementation code.
And, it helps test
HandleOrNull
andHandleOrInvalid
, and indeed, itturned up a bug:
OwnedHandle
also needs to be#[repr(transparent)]
,as it's used inside of
HandleOrNull
andHandleOrInvalid
which are also#[repr(transparent)]
.r? @joshtriplett