Skip to content

Commit 0cd81fc

Browse files
committed
Mark OwnedHandle as repr(transparent).
This corresponds to rust-lang/rust#94572, which was recently approved. Also, fix a warning about a doc comment on an extern block.
1 parent a743d1c commit 0cd81fc

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/example_ffi.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use winapi::{
2121
um::minwinbase::{LPOVERLAPPED, LPSECURITY_ATTRIBUTES},
2222
};
2323

24-
/// Declare a few FFI functions ourselves, to show off the FFI ergonomics.
24+
// Declare a few FFI functions ourselves, to show off the FFI ergonomics.
2525
#[cfg(all(rustc_attrs, any(unix, target_os = "wasi")))]
2626
extern "C" {
2727
pub fn open(pathname: *const c_char, flags: c_int, ...) -> Option<OwnedFd>;

src/types.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ impl OwnedFd {
206206
///
207207
/// [here]: https://devblogs.microsoft.com/oldnewthing/20040302-00/?p=40443
208208
#[cfg(windows)]
209+
#[repr(transparent)]
209210
pub struct OwnedHandle {
210211
handle: RawHandle,
211212
}

0 commit comments

Comments
 (0)