@@ -349,6 +349,7 @@ pub trait FromUnsafeSocket {
349
349
/// Note that this doesn't implement `Into*` or `From*` traits, as those imply
350
350
/// ownership transfers, and this type is non-owning.
351
351
#[ derive( Copy , Clone ) ]
352
+ #[ repr( transparent) ]
352
353
pub struct UnsafeHandle ( InnerFileOrSocket ) ;
353
354
354
355
/// A non-owning unsafe I/O handle which on Windows is limited to handling what
@@ -358,6 +359,7 @@ pub struct UnsafeHandle(InnerFileOrSocket);
358
359
///
359
360
/// [`RawHandle`]: https://doc.rust-lang.org/std/os/windows/io/type.RawHandle.html
360
361
#[ derive( Copy , Clone ) ]
362
+ #[ repr( transparent) ]
361
363
pub struct UnsafeFile ( InnerFile ) ;
362
364
363
365
/// A non-owning unsafe I/O handle which on Windows is limited to handling what
@@ -368,20 +370,23 @@ pub struct UnsafeFile(InnerFile);
368
370
///
369
371
/// [`RawSocket`]: https://doc.rust-lang.org/std/os/windows/io/type.RawSocket.html
370
372
#[ derive( Copy , Clone ) ]
373
+ #[ repr( transparent) ]
371
374
pub struct UnsafeSocket ( InnerSocket ) ;
372
375
373
376
/// A non-owning unsafe I/O handle that implements [`Read`]. `Read` functions
374
377
/// are considered safe, so this type requires `unsafe` to construct.
375
378
///
376
379
/// Like [`UnsafeHandle`], this doesn't implement `Into*` or `From*` traits.
377
380
#[ derive( Copy , Clone ) ]
381
+ #[ repr( transparent) ]
378
382
pub struct UnsafeReadable ( InnerFileOrSocket ) ;
379
383
380
384
/// A non-owning unsafe I/O handle that implements [`Write`]. `Write` functions
381
385
/// considered are safe, so this type requires `unsafe` to construct.
382
386
///
383
387
/// Like [`UnsafeHandle`], this doesn't implement `Into*` or `From*` traits.
384
388
#[ derive( Copy , Clone ) ]
389
+ #[ repr( transparent) ]
385
390
pub struct UnsafeWriteable ( InnerFileOrSocket ) ;
386
391
387
392
/// Posix-ish platforms use a single "file descriptor" type for all the kinds
0 commit comments