summaryrefslogtreecommitdiffstats
path: root/tests/ui/async-await/missed-capture-issue-107414.rs
blob: 0ab4f5ade9815ba3a428e90cc1fc66b64acf59af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// check-pass
// edition:2018

fn main() {}

struct StructA {}
struct StructB {}

impl StructA {
    fn fn_taking_struct_b(&self, struct_b: &StructB) -> bool {
        true
    }
}

async fn get_struct_a_async() -> StructA {
    StructA {}
}

async fn ice() {
    match Some(StructB {}) {
        Some(struct_b) if get_struct_a_async().await.fn_taking_struct_b(&struct_b) => {}
        _ => {}
    }
}