From c938001a4aa0cc848f48ad0853e03a2e193f8ae9 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Sun, 27 Nov 2022 17:08:35 +0900 Subject: [PATCH] Ignore clippy::let_underscore_future lint ``` warning: non-binding `let` on a future --> futures-util/src/future/select_all.rs:61:17 | 61 | let _ = self.inner.swap_remove(idx); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: consider awaiting the future or dropping explicitly with `std::mem::drop` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_future = note: `#[warn(clippy::let_underscore_future)]` on by default warning: non-binding `let` on a future --> futures/tests/async_await_macros.rs:385:5 | 385 | let _ = async { join!(async {}, async {}) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: consider awaiting the future or dropping explicitly with `std::mem::drop` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_future = note: `#[warn(clippy::let_underscore_future)]` on by default warning: non-binding `let` on a future --> futures/tests/async_await_macros.rs:390:5 | 390 | let _ = async { try_join!(async { Ok::<(), ()>(()) }, async { Ok::<(), ()>(()) },) }; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: consider awaiting the future or dropping explicitly with `std::mem::drop` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#let_underscore_future ``` --- futures-util/src/future/select_all.rs | 1 + futures/tests/async_await_macros.rs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/futures-util/src/future/select_all.rs b/futures-util/src/future/select_all.rs index 07d65cae79..0a51d0da6c 100644 --- a/futures-util/src/future/select_all.rs +++ b/futures-util/src/future/select_all.rs @@ -58,6 +58,7 @@ impl Future for SelectAll { }); match item { Some((idx, res)) => { + #[allow(clippy::let_underscore_future)] let _ = self.inner.swap_remove(idx); let rest = mem::take(&mut self.inner); Poll::Ready((res, idx, rest)) diff --git a/futures/tests/async_await_macros.rs b/futures/tests/async_await_macros.rs index 250e345305..82a617f2c2 100644 --- a/futures/tests/async_await_macros.rs +++ b/futures/tests/async_await_macros.rs @@ -380,11 +380,13 @@ fn try_join_size() { assert_eq!(mem::size_of_val(&fut), 48); } +#[allow(clippy::let_underscore_future)] #[test] fn join_doesnt_require_unpin() { let _ = async { join!(async {}, async {}) }; } +#[allow(clippy::let_underscore_future)] #[test] fn try_join_doesnt_require_unpin() { let _ = async { try_join!(async { Ok::<(), ()>(()) }, async { Ok::<(), ()>(()) },) };