summaryrefslogtreecommitdiffstats
path: root/library/std/src/os/unix/io/tests.rs
blob: 84d2a7a1a91b4f391f5c79161708c01664d93273 (plain)
1
2
3
4
5
6
7
8
9
10
11
use crate::mem::size_of;
use crate::os::unix::io::RawFd;

#[test]
fn test_raw_fd_layout() {
    // `OwnedFd` and `BorrowedFd` use `rustc_layout_scalar_valid_range_start`
    // and `rustc_layout_scalar_valid_range_end`, with values that depend on
    // the bit width of `RawFd`. If this ever changes, those values will need
    // to be updated.
    assert_eq!(size_of::<RawFd>(), 4);
}