mirror of
https://github.com/rust-lang/rust.git
synced 2025-11-18 18:28:20 +00:00
Preserve the Windows `GetLastError` error in `HandleOrInvalid`. In the `TryFrom<HandleOrInvalid> for OwnedHandle` and `TryFrom<HandleOrNull> for OwnedHandle` implemenations, `forget` the owned handle on the error path, to avoid calling `CloseHandle` on an invalid handle. It's harmless, except that it may overwrite the thread's `GetLastError` error. r? `@joshtriplett`