summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/building/uniform_array_move_out.move_out_from_end.built.after.mir
blob: 5090a4ba67518843ad5322ae85100eb6c8608966 (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
// MIR for `move_out_from_end` after built

fn move_out_from_end() -> () {
    let mut _0: ();                      // return place in scope 0 at $DIR/uniform_array_move_out.rs:+0:24: +0:24
    let _1: [std::boxed::Box<i32>; 2];   // in scope 0 at $DIR/uniform_array_move_out.rs:+1:9: +1:10
    let mut _2: std::boxed::Box<i32>;    // in scope 0 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
    let mut _3: usize;                   // in scope 0 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
    let mut _4: usize;                   // in scope 0 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
    let mut _5: *mut u8;                 // in scope 0 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
    let mut _6: std::boxed::Box<i32>;    // in scope 0 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
    let mut _7: std::boxed::Box<i32>;    // in scope 0 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
    let mut _8: usize;                   // in scope 0 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
    let mut _9: usize;                   // in scope 0 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
    let mut _10: *mut u8;                // in scope 0 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
    let mut _11: std::boxed::Box<i32>;   // in scope 0 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
    scope 1 {
        debug a => _1;                   // in scope 1 at $DIR/uniform_array_move_out.rs:+1:9: +1:10
        let _12: std::boxed::Box<i32>;   // in scope 1 at $DIR/uniform_array_move_out.rs:+7:14: +7:16
        scope 4 {
            debug _y => _12;             // in scope 4 at $DIR/uniform_array_move_out.rs:+7:14: +7:16
        }
    }
    scope 2 {
    }
    scope 3 {
    }

    bb0: {
        StorageLive(_1);                 // scope 0 at $DIR/uniform_array_move_out.rs:+1:9: +1:10
        StorageLive(_2);                 // scope 0 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
        _3 = SizeOf(i32);                // scope 2 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
        _4 = AlignOf(i32);               // scope 2 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
        _5 = alloc::alloc::exchange_malloc(move _3, move _4) -> [return: bb1, unwind: bb12]; // scope 2 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
                                         // mir::Constant
                                         // + span: $DIR/uniform_array_move_out.rs:7:9: 7:20
                                         // + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(<ZST>) }
    }

    bb1: {
        StorageLive(_6);                 // scope 0 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
        _6 = ShallowInitBox(move _5, i32); // scope 0 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
        (*_6) = const 1_i32;             // scope 0 at $DIR/uniform_array_move_out.rs:+3:18: +3:19
        _2 = move _6;                    // scope 0 at $DIR/uniform_array_move_out.rs:+3:9: +3:20
        drop(_6) -> [return: bb2, unwind: bb11]; // scope 0 at $DIR/uniform_array_move_out.rs:+3:19: +3:20
    }

    bb2: {
        StorageDead(_6);                 // scope 0 at $DIR/uniform_array_move_out.rs:+3:19: +3:20
        StorageLive(_7);                 // scope 0 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
        _8 = SizeOf(i32);                // scope 3 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
        _9 = AlignOf(i32);               // scope 3 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
        _10 = alloc::alloc::exchange_malloc(move _8, move _9) -> [return: bb3, unwind: bb11]; // scope 3 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
                                         // mir::Constant
                                         // + span: $DIR/uniform_array_move_out.rs:9:9: 9:20
                                         // + literal: Const { ty: unsafe fn(usize, usize) -> *mut u8 {alloc::alloc::exchange_malloc}, val: Value(<ZST>) }
    }

    bb3: {
        StorageLive(_11);                // scope 0 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
        _11 = ShallowInitBox(move _10, i32); // scope 0 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
        (*_11) = const 2_i32;            // scope 0 at $DIR/uniform_array_move_out.rs:+5:18: +5:19
        _7 = move _11;                   // scope 0 at $DIR/uniform_array_move_out.rs:+5:9: +5:20
        drop(_11) -> [return: bb4, unwind: bb10]; // scope 0 at $DIR/uniform_array_move_out.rs:+5:19: +5:20
    }

    bb4: {
        StorageDead(_11);                // scope 0 at $DIR/uniform_array_move_out.rs:+5:19: +5:20
        _1 = [move _2, move _7];         // scope 0 at $DIR/uniform_array_move_out.rs:+1:13: +6:6
        drop(_7) -> [return: bb5, unwind: bb11]; // scope 0 at $DIR/uniform_array_move_out.rs:+6:5: +6:6
    }

    bb5: {
        StorageDead(_7);                 // scope 0 at $DIR/uniform_array_move_out.rs:+6:5: +6:6
        drop(_2) -> [return: bb6, unwind: bb12]; // scope 0 at $DIR/uniform_array_move_out.rs:+6:5: +6:6
    }

    bb6: {
        StorageDead(_2);                 // scope 0 at $DIR/uniform_array_move_out.rs:+6:5: +6:6
        FakeRead(ForLet(None), _1);      // scope 0 at $DIR/uniform_array_move_out.rs:+1:9: +1:10
        PlaceMention(_1);                // scope 1 at $DIR/uniform_array_move_out.rs:+7:20: +7:21
        StorageLive(_12);                // scope 1 at $DIR/uniform_array_move_out.rs:+7:14: +7:16
        _12 = move _1[1 of 2];           // scope 1 at $DIR/uniform_array_move_out.rs:+7:14: +7:16
        _0 = const ();                   // scope 0 at $DIR/uniform_array_move_out.rs:+0:24: +8:2
        drop(_12) -> [return: bb7, unwind: bb9]; // scope 1 at $DIR/uniform_array_move_out.rs:+8:1: +8:2
    }

    bb7: {
        StorageDead(_12);                // scope 1 at $DIR/uniform_array_move_out.rs:+8:1: +8:2
        drop(_1) -> [return: bb8, unwind: bb12]; // scope 0 at $DIR/uniform_array_move_out.rs:+8:1: +8:2
    }

    bb8: {
        StorageDead(_1);                 // scope 0 at $DIR/uniform_array_move_out.rs:+8:1: +8:2
        return;                          // scope 0 at $DIR/uniform_array_move_out.rs:+8:2: +8:2
    }

    bb9 (cleanup): {
        drop(_1) -> [return: bb12, unwind terminate]; // scope 0 at $DIR/uniform_array_move_out.rs:+8:1: +8:2
    }

    bb10 (cleanup): {
        drop(_7) -> [return: bb11, unwind terminate]; // scope 0 at $DIR/uniform_array_move_out.rs:+6:5: +6:6
    }

    bb11 (cleanup): {
        drop(_2) -> [return: bb12, unwind terminate]; // scope 0 at $DIR/uniform_array_move_out.rs:+6:5: +6:6
    }

    bb12 (cleanup): {
        resume;                          // scope 0 at $DIR/uniform_array_move_out.rs:+0:1: +8:2
    }
}