summaryrefslogtreecommitdiffstats
path: root/tests/mir-opt/pre-codegen/slice_index.slice_get_mut_usize.PreCodegen.after.panic-unwind.mir
blob: e4d9060d4cf51092fbba8814a0d2f339e9ffffab (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
// MIR for `slice_get_mut_usize` after PreCodegen

fn slice_get_mut_usize(_1: &mut [u32], _2: usize) -> Option<&mut u32> {
    debug slice => _1;
    debug index => _2;
    let mut _0: std::option::Option<&mut u32>;
    scope 1 (inlined core::slice::<impl [u32]>::get_mut::<usize>) {
        debug self => _1;
        debug index => _2;
        scope 2 (inlined <usize as SliceIndex<[u32]>>::get_mut) {
            debug self => _2;
            debug slice => _1;
            let mut _3: usize;
            let mut _4: bool;
            let mut _5: *mut [u32];
            let mut _7: *mut u32;
            let mut _8: &mut u32;
            scope 3 {
                scope 4 (inlined <usize as SliceIndex<[u32]>>::get_unchecked_mut) {
                    debug self => _2;
                    debug slice => _5;
                    let mut _6: *mut u32;
                    let mut _9: &[&str];
                    scope 5 {
                        scope 10 (inlined std::ptr::mut_ptr::<impl *mut [u32]>::as_mut_ptr) {
                            debug self => _5;
                        }
                        scope 11 (inlined std::ptr::mut_ptr::<impl *mut u32>::add) {
                            debug self => _6;
                            debug count => _2;
                            scope 12 {
                            }
                        }
                    }
                    scope 6 (inlined std::ptr::mut_ptr::<impl *mut [u32]>::len) {
                        debug self => _5;
                        let mut _10: *const [u32];
                        scope 7 (inlined std::ptr::metadata::<[u32]>) {
                            debug ptr => _10;
                            scope 8 {
                            }
                        }
                    }
                    scope 9 (inlined Arguments::<'_>::new_const) {
                        debug pieces => _9;
                    }
                }
            }
        }
    }

    bb0: {
        StorageLive(_7);
        StorageLive(_4);
        StorageLive(_3);
        _3 = Len((*_1));
        _4 = Lt(_2, move _3);
        switchInt(move _4) -> [0: bb1, otherwise: bb2];
    }

    bb1: {
        StorageDead(_3);
        _0 = const Option::<&mut u32>::None;
        goto -> bb3;
    }

    bb2: {
        StorageDead(_3);
        StorageLive(_8);
        StorageLive(_5);
        _5 = &raw mut (*_1);
        StorageLive(_9);
        StorageLive(_10);
        StorageLive(_6);
        _6 = _5 as *mut u32 (PtrToPtr);
        _7 = Offset(_6, _2);
        StorageDead(_6);
        StorageDead(_10);
        StorageDead(_9);
        StorageDead(_5);
        _8 = &mut (*_7);
        _0 = Option::<&mut u32>::Some(move _8);
        StorageDead(_8);
        goto -> bb3;
    }

    bb3: {
        StorageDead(_4);
        StorageDead(_7);
        return;
    }
}