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

fn slice_get_unchecked_mut_range(_1: &mut [u32], _2: std::ops::Range<usize>) -> &mut [u32] {
    debug slice => _1;
    debug index => _2;
    let mut _0: &mut [u32];
    scope 1 (inlined core::slice::<impl [u32]>::get_unchecked_mut::<std::ops::Range<usize>>) {
        debug self => _1;
        debug index => _2;
        let mut _3: *mut [u32];
        let mut _14: *mut [u32];
        scope 2 {
            scope 3 (inlined <std::ops::Range<usize> as SliceIndex<[u32]>>::get_unchecked_mut) {
                debug self => _2;
                debug slice => _3;
                let mut _4: usize;
                let mut _5: usize;
                let mut _7: *mut u32;
                let mut _8: usize;
                let mut _9: *mut u32;
                let _15: std::ops::Range<usize>;
                scope 4 {
                    debug this => _15;
                    scope 5 {
                        let _6: usize;
                        scope 6 {
                            debug new_len => _6;
                            scope 7 (inlined ptr::mut_ptr::<impl *mut [u32]>::as_mut_ptr) {
                                debug self => _3;
                            }
                            scope 8 (inlined ptr::mut_ptr::<impl *mut u32>::add) {
                                debug self => _7;
                                debug count => _8;
                                scope 9 {
                                }
                            }
                            scope 10 (inlined slice_from_raw_parts_mut::<u32>) {
                                debug data => _9;
                                debug len => _6;
                                let mut _10: *mut ();
                                scope 11 (inlined ptr::mut_ptr::<impl *mut u32>::cast::<()>) {
                                    debug self => _9;
                                }
                                scope 12 (inlined std::ptr::from_raw_parts_mut::<[u32]>) {
                                    debug data_address => _10;
                                    debug metadata => _6;
                                    let mut _11: *const ();
                                    let mut _12: std::ptr::metadata::PtrComponents<[u32]>;
                                    let mut _13: std::ptr::metadata::PtrRepr<[u32]>;
                                    scope 13 {
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }

    bb0: {
        StorageLive(_14);
        StorageLive(_3);
        _3 = &raw mut (*_1);
        StorageLive(_15);
        StorageLive(_6);
        StorageLive(_4);
        _4 = (_2.1: usize);
        StorageLive(_5);
        _5 = (_2.0: usize);
        _6 = SubUnchecked(move _4, move _5);
        StorageDead(_5);
        StorageDead(_4);
        StorageLive(_9);
        StorageLive(_7);
        _7 = _3 as *mut u32 (PtrToPtr);
        StorageLive(_8);
        _8 = (_2.0: usize);
        _9 = Offset(_7, _8);
        StorageDead(_8);
        StorageDead(_7);
        StorageLive(_10);
        _10 = _9 as *mut () (PtrToPtr);
        StorageLive(_13);
        StorageLive(_12);
        StorageLive(_11);
        _11 = _10 as *const () (PointerCoercion(MutToConstPointer));
        _12 = ptr::metadata::PtrComponents::<[u32]> { data_address: move _11, metadata: _6 };
        StorageDead(_11);
        _13 = ptr::metadata::PtrRepr::<[u32]> { const_ptr: move _12 };
        StorageDead(_12);
        _14 = (_13.1: *mut [u32]);
        StorageDead(_13);
        StorageDead(_10);
        StorageDead(_9);
        StorageDead(_6);
        StorageDead(_15);
        StorageDead(_3);
        _0 = &mut (*_14);
        StorageDead(_14);
        return;
    }
}