summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/pre-codegen/loops.vec_move.PreCodegen.after.mir
blob: 1b5f2a0884b010e16232fd834a3817efe6a2314a (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
// MIR for `vec_move` after PreCodegen

fn vec_move(_1: Vec<impl Sized>) -> () {
    debug v => _1;
    let mut _0: ();
    let mut _2: std::vec::IntoIter<impl Sized>;
    let mut _3: std::vec::IntoIter<impl Sized>;
    let mut _4: &mut std::vec::IntoIter<impl Sized>;
    let mut _5: std::option::Option<impl Sized>;
    let mut _6: isize;
    let _8: ();
    scope 1 {
        debug iter => _3;
        let _7: impl Sized;
        scope 2 {
            debug x => _7;
        }
    }

    bb0: {
        StorageLive(_2);
        _2 = <Vec<impl Sized> as IntoIterator>::into_iter(move _1) -> [return: bb1, unwind continue];
    }

    bb1: {
        StorageLive(_3);
        _3 = move _2;
        goto -> bb2;
    }

    bb2: {
        StorageLive(_5);
        _4 = &mut _3;
        _5 = <std::vec::IntoIter<impl Sized> as Iterator>::next(_4) -> [return: bb3, unwind: bb9];
    }

    bb3: {
        _6 = discriminant(_5);
        switchInt(move _6) -> [0: bb4, 1: bb6, otherwise: bb8];
    }

    bb4: {
        StorageDead(_5);
        drop(_3) -> [return: bb5, unwind continue];
    }

    bb5: {
        StorageDead(_3);
        StorageDead(_2);
        return;
    }

    bb6: {
        _7 = move ((_5 as Some).0: impl Sized);
        _8 = opaque::<impl Sized>(move _7) -> [return: bb7, unwind: bb9];
    }

    bb7: {
        StorageDead(_5);
        goto -> bb2;
    }

    bb8: {
        unreachable;
    }

    bb9 (cleanup): {
        drop(_3) -> [return: bb10, unwind terminate];
    }

    bb10 (cleanup): {
        resume;
    }
}