Skip to content

Commit

Permalink
Mark OwnedHandle as repr(transparent).
Browse files Browse the repository at this point in the history
This corresponds to rust-lang/rust#94572, which was recently approved.

Also, fix a warning about a doc comment on an extern block.
  • Loading branch information
sunfishcode committed Mar 4, 2022
1 parent a743d1c commit 0cd81fc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/example_ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ use winapi::{
um::minwinbase::{LPOVERLAPPED, LPSECURITY_ATTRIBUTES},
};

/// Declare a few FFI functions ourselves, to show off the FFI ergonomics.
// Declare a few FFI functions ourselves, to show off the FFI ergonomics.
#[cfg(all(rustc_attrs, any(unix, target_os = "wasi")))]
extern "C" {
pub fn open(pathname: *const c_char, flags: c_int, ...) -> Option<OwnedFd>;
Expand Down
1 change: 1 addition & 0 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ impl OwnedFd {
///
/// [here]: https://devblogs.microsoft.com/oldnewthing/20040302-00/?p=40443
#[cfg(windows)]
#[repr(transparent)]
pub struct OwnedHandle {
handle: RawHandle,
}
Expand Down

0 comments on commit 0cd81fc

Please sign in to comment.