This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +30
-0
lines changed Expand file tree Collapse file tree 4 files changed +30
-0
lines changed Original file line number Diff line number Diff line change 2
2
3
3
#![ unstable( feature = "io_safety" , issue = "87074" ) ]
4
4
5
+ // Tests for this module
6
+ #[ cfg( test) ]
7
+ mod tests;
8
+
5
9
use super :: raw:: { AsRawFd , FromRawFd , IntoRawFd , RawFd } ;
6
10
use crate :: fmt;
7
11
use crate :: fs;
Original file line number Diff line number Diff line change
1
+ use crate :: mem:: size_of;
2
+ use crate :: os:: unix:: io:: RawFd ;
3
+
4
+ #[ test]
5
+ fn test_raw_fd_layout ( ) {
6
+ // `OwnedFd` and `BorrowedFd` use `rustc_layout_scalar_valid_range_start`
7
+ // and `rustc_layout_scalar_valid_range_end`, with values that depend on
8
+ // the bit width of `RawFd`. If this ever changes, those values will need
9
+ // to be updated.
10
+ assert_eq ! ( size_of:: <RawFd >( ) , 4 ) ;
11
+ }
Original file line number Diff line number Diff line change 2
2
3
3
#![ unstable( feature = "wasi_ext" , issue = "71213" ) ]
4
4
5
+ // Tests for this module
6
+ #[ cfg( test) ]
7
+ mod tests;
8
+
5
9
use super :: raw:: { AsRawFd , FromRawFd , IntoRawFd , RawFd } ;
6
10
use crate :: fmt;
7
11
use crate :: fs;
Original file line number Diff line number Diff line change
1
+ use std:: mem:: size_of;
2
+ use std:: os:: wasi:: io:: RawFd ;
3
+
4
+ #[ test]
5
+ fn test_raw_fd_layout ( ) {
6
+ /// `OwnedFd` and `BorrowedFd` use `rustc_layout_scalar_valid_range_start`
7
+ /// and `rustc_layout_scalar_valid_range_end`, with values that depend on
8
+ /// the bit width of `RawFd`. If this ever changes, those values will need
9
+ /// to be updated.
10
+ assert_eq ! ( size_of:: <RawFd >( ) , 4 ) ;
11
+ }
You can’t perform that action at this time.
0 commit comments