about summary refs log tree commit diff
path: root/tests/ui/async-await/higher-ranked-auto-trait-15.rs
blob: 153fcac4c3ae054212ad9e6385f4b84aee237d53 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// Repro for <https://github.com/rust-lang/rust/issues/126044#issuecomment-2154313449>.
//@ edition: 2021
//@ revisions: assumptions no_assumptions
//@[assumptions] compile-flags: -Zhigher-ranked-assumptions
//@[assumptions] check-pass
//@[no_assumptions] known-bug: #110338

async fn listen() {
    let things: Vec<Vec<i32>> = vec![];
    for _ in things.iter().map(|n| n.iter()).flatten() {
        // comment this line and everything compiles
        async {}.await;
    }
}

fn require_send<T: Send>(_x: T) {}

fn main() {
    let future = listen();
    require_send(future);
}