summaryrefslogtreecommitdiffstats
path: root/tests/ui/async-await/issues/issue-64964.rs
blob: 6d6eff4864ee3663cc1c415d4d9304a25932e433 (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
// incremental
// compile-flags: -Z query-dep-graph
// edition:2018

// Regression test for ICE related to `await`ing in a method + incr. comp. (#64964)

struct Body;
impl Body {
    async fn next(&mut self) {
        async {}.await
    }
}

// Another reproduction: `await`ing with a variable from for-loop.

async fn bar() {
    for x in 0..10 {
        async { Some(x) }.await.unwrap();
    }
}

fn main() {}