about summary refs log tree commit diff
path: root/tests/ui/dropck/coroutine-liveness-2.rs
blob: 3ef1400a41e6aecb94568b91f630e5b5cdecf514 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//@ check-pass
//@ edition: 2021

// regression test found while working on #117134.
use std::future;

fn main() {
    let mut recv = future::ready(());
    let _combined_fut = async {
        let _ = || read(&mut recv);
    };

    let _uwu = (String::new(), _combined_fut);
    // Dropping a coroutine as part of a more complex
    // types should not add unnecessary liveness
    // constraints.

    drop(recv);
}

fn read<F: future::Future>(_: &mut F) -> F::Output {
    todo!()
}