]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #88798 - sunfishcode:sunfishcode/windows-null-handles, r=joshtriplett
authorbors <bors@rust-lang.org>
Thu, 11 Nov 2021 12:07:53 +0000 (12:07 +0000)
committerbors <bors@rust-lang.org>
Thu, 11 Nov 2021 12:07:53 +0000 (12:07 +0000)
Fix assertion failures in `OwnedHandle` with `windows_subsystem`.

As discussed in #88576, raw handle values in Windows can be null, such
as in `windows_subsystem` mode, or when consoles are detached from a
process. So, don't use `NonNull` to hold them, don't assert that they're
not null, and remove `OwnedHandle`'s `repr(transparent)`. Introduce a
new `HandleOrNull` type, similar to `HandleOrInvalid`, to cover the FFI
use case.

r? `@joshtriplett`


Trivial merge