summaryrefslogtreecommitdiffstats
path: root/src/tools/clippy/tests/ui/let_underscore_future.rs
blob: d8f54cdca91209ba8bb47f24a975ec6ad596e3ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use std::future::Future;

async fn some_async_fn() {}

fn sync_side_effects() {}
fn custom() -> impl Future<Output = ()> {
    sync_side_effects();
    async {}
}

fn do_something_to_future(future: &mut impl Future<Output = ()>) {}

fn main() {
    let _ = some_async_fn();
    let _ = custom();

    let mut future = some_async_fn();
    do_something_to_future(&mut future);
    let _ = future;
}