about summary refs log tree commit diff
path: root/library/std/src/os/unix/io/tests.rs
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2022-10-21 10:18:54 +0200
committerRalf Jung <post@ralfj.de>2022-10-21 10:18:54 +0200
commit9b57a2f55a76fa1e3d000932e0a708adb587990c (patch)
tree53c592b83ed6929eb66beb179586d09409fc3088 /library/std/src/os/unix/io/tests.rs
parent53e357748675b387b6d25fe563b960cb7a7a0aea (diff)
parentb1ab3b738ac718da74cd4aa0bb7f362d0adbdf84 (diff)
downloadrust-9b57a2f55a76fa1e3d000932e0a708adb587990c.tar.gz
rust-9b57a2f55a76fa1e3d000932e0a708adb587990c.zip
merge rustc history
Diffstat (limited to 'library/std/src/os/unix/io/tests.rs')
-rw-r--r--library/std/src/os/unix/io/tests.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/library/std/src/os/unix/io/tests.rs b/library/std/src/os/unix/io/tests.rs
new file mode 100644
index 00000000000..84d2a7a1a91
--- /dev/null
+++ b/library/std/src/os/unix/io/tests.rs
@@ -0,0 +1,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);
+}