about summary refs log tree commit diff
path: root/tests/mir-opt/pre-codegen/slice_iter.slice_iter_mut_next_back.PreCodegen.after.panic-unwind.mir
blob: 62b738c36bf4b00a87f355a2992ba59986d7226f (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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
// MIR for `slice_iter_mut_next_back` after PreCodegen

fn slice_iter_mut_next_back(_1: &mut std::slice::IterMut<'_, T>) -> Option<&mut T> {
    debug it => _1;
    let mut _0: std::option::Option<&mut T>;
    scope 1 (inlined <std::slice::IterMut<'_, T> as DoubleEndedIterator>::next_back) {
        let mut _2: *mut T;
        let mut _7: bool;
        let mut _8: *mut T;
        let mut _21: &mut T;
        scope 2 {
            let _3: std::ptr::NonNull<T>;
            let _9: usize;
            scope 3 {
            }
            scope 4 {
                scope 7 (inlined <NonNull<T> as PartialEq>::eq) {
                    let mut _4: std::ptr::NonNull<T>;
                    let mut _5: *mut T;
                    let mut _6: *mut T;
                    scope 8 (inlined NonNull::<T>::as_ptr) {
                    }
                    scope 9 (inlined NonNull::<T>::as_ptr) {
                    }
                }
            }
            scope 5 (inlined std::ptr::mut_ptr::<impl *mut T>::addr) {
                scope 6 (inlined std::ptr::mut_ptr::<impl *mut T>::cast::<()>) {
                }
            }
        }
        scope 10 (inlined std::slice::IterMut::<'_, T>::next_back_unchecked) {
            let mut _15: std::ptr::NonNull<T>;
            scope 11 (inlined std::slice::IterMut::<'_, T>::pre_dec_end) {
                let mut _10: *mut *mut T;
                let mut _11: *mut std::ptr::NonNull<T>;
                let mut _12: std::ptr::NonNull<T>;
                let mut _16: *mut *mut T;
                let mut _17: *mut usize;
                let mut _18: usize;
                let mut _19: usize;
                scope 12 {
                    scope 13 {
                    }
                    scope 14 {
                        scope 17 (inlined NonNull::<T>::sub) {
                            scope 18 (inlined #[track_caller] core::num::<impl isize>::unchecked_neg) {
                                scope 19 (inlined core::ub_checks::check_language_ub) {
                                    scope 20 (inlined core::ub_checks::check_language_ub::runtime) {
                                    }
                                }
                            }
                            scope 21 (inlined NonNull::<T>::offset) {
                                let mut _13: *const T;
                                let mut _14: *const T;
                                scope 22 (inlined NonNull::<T>::as_ptr) {
                                }
                            }
                        }
                    }
                    scope 15 (inlined std::ptr::mut_ptr::<impl *mut *mut T>::cast::<usize>) {
                    }
                    scope 16 (inlined std::ptr::mut_ptr::<impl *mut *mut T>::cast::<NonNull<T>>) {
                    }
                }
            }
            scope 23 (inlined NonNull::<T>::as_mut::<'_>) {
                let mut _20: *mut T;
                scope 24 (inlined NonNull::<T>::as_ptr) {
                }
            }
        }
    }

    bb0: {
        StorageLive(_9);
        StorageLive(_8);
        StorageLive(_3);
        StorageLive(_2);
        StorageLive(_21);
        StorageLive(_7);
        switchInt(const <T as std::mem::SizedTypeProperties>::IS_ZST) -> [0: bb1, otherwise: bb2];
    }

    bb1: {
        _2 = copy ((*_1).1: *mut T);
        _3 = copy _2 as std::ptr::NonNull<T> (Transmute);
        StorageLive(_5);
        StorageLive(_4);
        _4 = copy ((*_1).0: std::ptr::NonNull<T>);
        _5 = copy _4 as *mut T (Transmute);
        StorageDead(_4);
        StorageLive(_6);
        _6 = copy _3 as *mut T (Transmute);
        _7 = Eq(copy _5, copy _6);
        StorageDead(_6);
        StorageDead(_5);
        goto -> bb3;
    }

    bb2: {
        _8 = copy ((*_1).1: *mut T);
        _9 = copy _8 as usize (Transmute);
        _7 = Eq(copy _9, const 0_usize);
        goto -> bb3;
    }

    bb3: {
        switchInt(move _7) -> [0: bb4, otherwise: bb10];
    }

    bb4: {
        StorageLive(_15);
        StorageLive(_17);
        StorageLive(_11);
        StorageLive(_12);
        switchInt(const <T as std::mem::SizedTypeProperties>::IS_ZST) -> [0: bb5, otherwise: bb8];
    }

    bb5: {
        StorageLive(_10);
        _10 = &raw mut ((*_1).1: *mut T);
        _11 = copy _10 as *mut std::ptr::NonNull<T> (PtrToPtr);
        StorageDead(_10);
        _12 = copy (*_11);
        switchInt(const <T as std::mem::SizedTypeProperties>::IS_ZST) -> [0: bb6, otherwise: bb7];
    }

    bb6: {
        StorageLive(_14);
        StorageLive(_13);
        _13 = copy _12 as *const T (Transmute);
        _14 = Offset(copy _13, const -1_isize);
        StorageDead(_13);
        _12 = NonNull::<T> { pointer: copy _14 };
        StorageDead(_14);
        goto -> bb7;
    }

    bb7: {
        (*_11) = move _12;
        _15 = copy (*_11);
        goto -> bb9;
    }

    bb8: {
        StorageLive(_16);
        _16 = &raw mut ((*_1).1: *mut T);
        _17 = copy _16 as *mut usize (PtrToPtr);
        StorageDead(_16);
        StorageLive(_19);
        StorageLive(_18);
        _18 = copy (*_17);
        _19 = SubUnchecked(move _18, const 1_usize);
        StorageDead(_18);
        (*_17) = move _19;
        StorageDead(_19);
        _15 = copy ((*_1).0: std::ptr::NonNull<T>);
        goto -> bb9;
    }

    bb9: {
        StorageDead(_12);
        StorageDead(_11);
        StorageDead(_17);
        StorageLive(_20);
        _20 = copy _15 as *mut T (Transmute);
        _21 = &mut (*_20);
        StorageDead(_20);
        StorageDead(_15);
        _0 = Option::<&mut T>::Some(copy _21);
        goto -> bb11;
    }

    bb10: {
        _0 = const {transmute(0x0000000000000000): Option<&mut T>};
        goto -> bb11;
    }

    bb11: {
        StorageDead(_7);
        StorageDead(_21);
        StorageDead(_2);
        StorageDead(_3);
        StorageDead(_8);
        StorageDead(_9);
        return;
    }
}