about summary refs log tree commit diff
path: root/tests/ui/rustc_public-ir-print/async-closure.stdout
blob: 4afb15af7a9338059ae4a119e366af5a229e938f (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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
// WARNING: This is highly experimental output it's intended for rustc_public developers only.
// If you find a bug or want to improve the output open a issue at https://github.com/rust-lang/project-stable-mir.
fn foo() -> () {
    let mut _0: ();
    let  _1: i32;
    let  _2: {async closure@$DIR/async-closure.rs:9:13: 9:21};
    let mut _3: &i32;
    debug y => _1;
    debug x => _2;
    bb0: {
        StorageLive(_1);
        _1 = 0_i32;
        StorageLive(_2);
        StorageLive(_3);
        _3 = &_1;
        _2 = {coroutine-closure@$DIR/async-closure.rs:9:13: 9:21}(move _3);
        StorageDead(_3);
        _0 = ();
        StorageDead(_2);
        StorageDead(_1);
        return;
    }
}
fn foo::{closure#0}(_1: &{async closure@$DIR/async-closure.rs:9:13: 9:21}) -> {async closure body@$DIR/async-closure.rs:9:22: 11:6} {
    let mut _0: {async closure body@$DIR/async-closure.rs:9:22: 11:6};
    let mut _2: &i32;
    let mut _3: &i32;
    debug y => (*((*_1).0: &i32));
    bb0: {
        StorageLive(_2);
        _3 = CopyForDeref(((*_1).0: &i32));
        _2 = &(*_3);
        _0 = {coroutine@$DIR/async-closure.rs:9:22: 11:6}(move _2);
        StorageDead(_2);
        return;
    }
}
fn foo::{closure#0}::{closure#0}(_1: Pin<&mut {async closure body@$DIR/async-closure.rs:9:22: 11:6}>, _2: &mut Context<'_>) -> Poll<()> {
    let mut _0: Poll<()>;
    let  _3: i32;
    let mut _4: &i32;
    let mut _5: ();
    let mut _6: &mut Context<'_>;
    let mut _7: u32;
    let mut _8: &mut {async closure body@$DIR/async-closure.rs:9:22: 11:6};
    let mut _9: &mut {async closure body@$DIR/async-closure.rs:9:22: 11:6};
    let mut _10: &mut {async closure body@$DIR/async-closure.rs:9:22: 11:6};
    debug _task_context => _6;
    debug y => (*((*(_1.0: &mut {async closure body@$DIR/async-closure.rs:9:22: 11:6})).0: &i32));
    debug y => _3;
    bb0: {
        _8 = CopyForDeref((_1.0: &mut {async closure body@$DIR/async-closure.rs:9:22: 11:6}));
        _7 = discriminant((*_8));
        switchInt(move _7) -> [0: bb1, 1: bb2, otherwise: bb3];
    }
    bb1: {
        _6 = move _2;
        StorageLive(_3);
        _9 = CopyForDeref((_1.0: &mut {async closure body@$DIR/async-closure.rs:9:22: 11:6}));
        _4 = CopyForDeref(((*_9).0: &i32));
        _3 = (*_4);
        _5 = ();
        StorageDead(_3);
        _0 = std::task::Poll::Ready(move _5);
        _10 = CopyForDeref((_1.0: &mut {async closure body@$DIR/async-closure.rs:9:22: 11:6}));
        discriminant((*_10) = 1;
        return;
    }
    bb2: {
        assert(false, `async fn` resumed after completion) -> [success: bb2, unwind unreachable];
    }
    bb3: {
        unreachable;
    }
}
fn foo::{closure#0}::{synthetic#0}(_1: Pin<&mut {async closure body@$DIR/async-closure.rs:9:22: 11:6}>, _2: &mut Context<'_>) -> Poll<()> {
    let mut _0: Poll<()>;
    let  _3: i32;
    let mut _4: &i32;
    let mut _5: ();
    let mut _6: &mut Context<'_>;
    let mut _7: u32;
    let mut _8: &mut {async closure body@$DIR/async-closure.rs:9:22: 11:6};
    let mut _9: &mut {async closure body@$DIR/async-closure.rs:9:22: 11:6};
    let mut _10: &mut {async closure body@$DIR/async-closure.rs:9:22: 11:6};
    debug _task_context => _6;
    debug y => (*((*(_1.0: &mut {async closure body@$DIR/async-closure.rs:9:22: 11:6})).0: &i32));
    debug y => _3;
    bb0: {
        _8 = CopyForDeref((_1.0: &mut {async closure body@$DIR/async-closure.rs:9:22: 11:6}));
        _7 = discriminant((*_8));
        switchInt(move _7) -> [0: bb1, 1: bb2, otherwise: bb3];
    }
    bb1: {
        _6 = move _2;
        StorageLive(_3);
        _9 = CopyForDeref((_1.0: &mut {async closure body@$DIR/async-closure.rs:9:22: 11:6}));
        _4 = CopyForDeref(((*_9).0: &i32));
        _3 = (*_4);
        _5 = ();
        StorageDead(_3);
        _0 = std::task::Poll::Ready(move _5);
        _10 = CopyForDeref((_1.0: &mut {async closure body@$DIR/async-closure.rs:9:22: 11:6}));
        discriminant((*_10) = 1;
        return;
    }
    bb2: {
        assert(false, `async fn` resumed after completion) -> [success: bb2, unwind unreachable];
    }
    bb3: {
        unreachable;
    }
}