Skip to content

Commit

Permalink
chore: fix chores (#4060)
Browse files Browse the repository at this point in the history
  • Loading branch information
Darksonn committed Aug 24, 2021
1 parent 84f6845 commit 7e47464
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
1 change: 1 addition & 0 deletions tokio/src/lib.rs
Expand Up @@ -16,6 +16,7 @@
attr(deny(warnings, rust_2018_idioms), allow(dead_code, unused_variables))
))]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![cfg_attr(docsrs, allow(unused_attributes))]

//! A runtime for writing reliable network applications without compromising speed.
//!
Expand Down
2 changes: 1 addition & 1 deletion tokio/src/macros/cfg.rs
Expand Up @@ -176,7 +176,7 @@ macro_rules! cfg_net_unix {
($($item:item)*) => {
$(
#[cfg(all(unix, feature = "net"))]
#[cfg_attr(docsrs, doc(cfg(feature = "net")))]
#[cfg_attr(docsrs, doc(cfg(all(unix, feature = "net"))))]
$item
)*
}
Expand Down
18 changes: 10 additions & 8 deletions tokio/tests/io_async_fd.rs
Expand Up @@ -15,7 +15,7 @@ use std::{

use nix::unistd::{close, read, write};

use futures::{poll, FutureExt};
use futures::poll;

use tokio::io::unix::{AsyncFd, AsyncFdReadyGuard};
use tokio_test::{assert_err, assert_pending};
Expand Down Expand Up @@ -163,10 +163,11 @@ async fn initially_writable() {
afd_a.writable().await.unwrap().clear_ready();
afd_b.writable().await.unwrap().clear_ready();

futures::select_biased! {
_ = tokio::time::sleep(Duration::from_millis(10)).fuse() => {},
_ = afd_a.readable().fuse() => panic!("Unexpected readable state"),
_ = afd_b.readable().fuse() => panic!("Unexpected readable state"),
tokio::select! {
biased;
_ = tokio::time::sleep(Duration::from_millis(10)) => {},
_ = afd_a.readable() => panic!("Unexpected readable state"),
_ = afd_b.readable() => panic!("Unexpected readable state"),
}
}

Expand Down Expand Up @@ -353,12 +354,13 @@ async fn multiple_waiters() {
futures::future::pending::<()>().await;
};

futures::select_biased! {
guard = afd_a.readable().fuse() => {
tokio::select! {
biased;
guard = afd_a.readable() => {
tokio::task::yield_now().await;
guard.unwrap().clear_ready()
},
_ = notify_barrier.fuse() => unreachable!(),
_ = notify_barrier => unreachable!(),
}

std::mem::drop(afd_a);
Expand Down

0 comments on commit 7e47464

Please sign in to comment.