Skip to content

Commit

Permalink
Ignore clippy::let_underscore_future lint
Browse files Browse the repository at this point in the history
```
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
```
  • Loading branch information
taiki-e committed Nov 27, 2022
1 parent 3b0378b commit c938001
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions futures-util/src/future/select_all.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ impl<Fut: Future + Unpin> Future for SelectAll<Fut> {
});
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))
Expand Down
2 changes: 2 additions & 0 deletions futures/tests/async_await_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<(), ()>(()) },) };
Expand Down

0 comments on commit c938001

Please sign in to comment.