summaryrefslogtreecommitdiffstats
path: root/tokio/tests/macros_select.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tokio/tests/macros_select.rs')
-rw-r--r--tokio/tests/macros_select.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/tokio/tests/macros_select.rs b/tokio/tests/macros_select.rs
index cc214bbb..3359849d 100644
--- a/tokio/tests/macros_select.rs
+++ b/tokio/tests/macros_select.rs
@@ -359,12 +359,14 @@ async fn join_with_select() {
async fn use_future_in_if_condition() {
use tokio::time::{self, Duration};
- let mut sleep = time::sleep(Duration::from_millis(50));
+ let sleep = time::sleep(Duration::from_millis(50));
+ tokio::pin!(sleep);
tokio::select! {
- _ = &mut sleep, if !sleep.is_elapsed() => {
+ _ = time::sleep(Duration::from_millis(50)), if false => {
+ panic!("if condition ignored")
}
- _ = async { 1 } => {
+ _ = async { 1u32 } => {
}
}
}