diff --git a/tokio/Cargo.toml b/tokio/Cargo.toml index 4c4402227a2..c84b04462b2 100644 --- a/tokio/Cargo.toml +++ b/tokio/Cargo.toml @@ -118,7 +118,7 @@ signal-hook-registry = { version = "1.1.1", optional = true } [target.'cfg(unix)'.dev-dependencies] libc = { version = "0.2.149" } -nix = { version = "0.26", default-features = false, features = ["fs", "socket"] } +nix = { version = "0.27.1", default-features = false, features = ["fs", "socket"] } [target.'cfg(windows)'.dependencies.windows-sys] version = "0.48" diff --git a/tokio/tests/io_async_fd.rs b/tokio/tests/io_async_fd.rs index 943b023ecb3..bacf8e843c9 100644 --- a/tokio/tests/io_async_fd.rs +++ b/tokio/tests/io_async_fd.rs @@ -1,7 +1,7 @@ #![warn(rust_2018_idioms)] #![cfg(all(unix, feature = "full"))] -use std::os::unix::io::{AsRawFd, RawFd}; +use std::os::unix::io::{AsRawFd, IntoRawFd, RawFd}; use std::sync::{ atomic::{AtomicBool, Ordering}, Arc, @@ -132,7 +132,14 @@ fn socketpair() -> (FileDescriptor, FileDescriptor) { SockFlag::empty(), ) .expect("socketpair"); - let fds = (FileDescriptor { fd: fd_a }, FileDescriptor { fd: fd_b }); + let fds = ( + FileDescriptor { + fd: fd_a.into_raw_fd(), + }, + FileDescriptor { + fd: fd_b.into_raw_fd(), + }, + ); set_nonblocking(fds.0.fd); set_nonblocking(fds.1.fd);