diff options
| author | Dan Gohman <dev@sunfishcode.online> | 2021-06-30 21:44:30 -0700 |
|---|---|---|
| committer | Dan Gohman <dev@sunfishcode.online> | 2021-08-19 12:02:39 -0700 |
| commit | d15418586ca78ead4f87ad18fcffa3550c1b169e (patch) | |
| tree | 93234d47e5eab3c9177ad31b9369abcd1c1ed5d1 /library/std/src/net | |
| parent | 2451f42c1deb9379d5e8e5fa86b0bf857ae048ec (diff) | |
I/O safety.
Introduce `OwnedFd` and `BorrowedFd`, and the `AsFd` trait, and implementations of `AsFd`, `From<OwnedFd>` and `From<T> for OwnedFd` for relevant types, along with Windows counterparts for handles and sockets. Tracking issue: - <https://github.com/rust-lang/rust/issues/87074> RFC: - <https://github.com/rust-lang/rfcs/blob/master/text/3128-io-safety.md>
Diffstat (limited to 'library/std/src/net')
| -rw-r--r-- | library/std/src/net/udp/tests.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/library/std/src/net/udp/tests.rs b/library/std/src/net/udp/tests.rs index fbed3d32d45..a51113dd9e7 100644 --- a/library/std/src/net/udp/tests.rs +++ b/library/std/src/net/udp/tests.rs @@ -2,7 +2,6 @@ use crate::io::ErrorKind; use crate::net::test::{next_test_ip4, next_test_ip6}; use crate::net::*; use crate::sync::mpsc::channel; -use crate::sys_common::AsInner; use crate::thread; use crate::time::{Duration, Instant}; @@ -173,7 +172,7 @@ fn debug() { let socket_addr = next_test_ip4(); let udpsock = t!(UdpSocket::bind(&socket_addr)); - let udpsock_inner = udpsock.0.socket().as_inner(); + let udpsock_inner = udpsock.0.socket().as_raw(); let compare = format!("UdpSocket {{ addr: {:?}, {}: {:?} }}", socket_addr, name, udpsock_inner); assert_eq!(format!("{:?}", udpsock), compare); } |
