about summary refs log tree commit diff
path: root/tests/mir-opt/pre-codegen/slice_iter.slice_iter_next.PreCodegen.after.panic-unwind.mir
blob: c0ed0aea1e2600f1d387777f1fa5bf4c0f90fa0e (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
// MIR for `slice_iter_next` after PreCodegen

fn slice_iter_next(_1: &mut std::slice::Iter<'_, T>) -> Option<&T> {
    debug it => _1;
    let mut _0: std::option::Option<&T>;
    scope 1 (inlined <std::slice::Iter<'_, T> as Iterator>::next) {
        let _2: std::ptr::NonNull<T>;
        let _4: std::ptr::NonNull<T>;
        let mut _7: bool;
        let mut _10: std::ptr::NonNull<T>;
        let mut _12: usize;
        let _14: &T;
        scope 2 {
            let _3: *const T;
            scope 3 {
                let _11: usize;
                scope 4 {
                    scope 7 (inlined #[track_caller] core::num::<impl usize>::unchecked_sub) {
                        scope 8 (inlined core::ub_checks::check_language_ub) {
                            scope 9 (inlined core::ub_checks::check_language_ub::runtime) {
                            }
                        }
                    }
                    scope 10 (inlined without_provenance_mut::<T>) {
                    }
                }
                scope 5 (inlined std::ptr::const_ptr::<impl *const T>::addr) {
                    scope 6 (inlined std::ptr::const_ptr::<impl *const T>::cast::<()>) {
                    }
                }
                scope 11 (inlined <NonNull<T> as PartialEq>::eq) {
                    let mut _5: *mut T;
                    let mut _6: *mut T;
                    scope 12 (inlined NonNull::<T>::as_ptr) {
                    }
                    scope 13 (inlined NonNull::<T>::as_ptr) {
                    }
                }
                scope 14 (inlined NonNull::<T>::add) {
                    let mut _8: *const T;
                    let mut _9: *const T;
                    scope 15 (inlined NonNull::<T>::as_ptr) {
                    }
                }
                scope 16 (inlined NonNull::<T>::as_ref::<'_>) {
                    let _13: *const T;
                    scope 17 (inlined NonNull::<T>::as_ptr) {
                    }
                    scope 18 (inlined std::ptr::mut_ptr::<impl *mut T>::cast_const) {
                    }
                }
            }
        }
    }

    bb0: {
        StorageLive(_2);
        StorageLive(_3);
        StorageLive(_11);
        StorageLive(_12);
        StorageLive(_4);
        StorageLive(_14);
        _2 = copy ((*_1).0: std::ptr::NonNull<T>);
        _3 = copy ((*_1).1: *const T);
        switchInt(const <T as std::mem::SizedTypeProperties>::IS_ZST) -> [0: bb1, otherwise: bb4];
    }

    bb1: {
        StorageLive(_7);
        _4 = copy _3 as std::ptr::NonNull<T> (Transmute);
        StorageLive(_5);
        _5 = copy _2 as *mut T (Transmute);
        StorageLive(_6);
        _6 = copy _4 as *mut T (Transmute);
        _7 = Eq(move _5, move _6);
        StorageDead(_6);
        StorageDead(_5);
        switchInt(move _7) -> [0: bb2, otherwise: bb3];
    }

    bb2: {
        StorageDead(_7);
        StorageLive(_10);
        StorageLive(_9);
        StorageLive(_8);
        _8 = copy _2 as *const T (Transmute);
        _9 = Offset(move _8, const 1_usize);
        StorageDead(_8);
        _10 = NonNull::<T> { pointer: move _9 };
        StorageDead(_9);
        ((*_1).0: std::ptr::NonNull<T>) = move _10;
        StorageDead(_10);
        goto -> bb7;
    }

    bb3: {
        _0 = const {transmute(0x0000000000000000): Option<&T>};
        StorageDead(_7);
        goto -> bb8;
    }

    bb4: {
        _11 = copy _3 as usize (Transmute);
        switchInt(copy _11) -> [0: bb5, otherwise: bb6];
    }

    bb5: {
        _0 = const {transmute(0x0000000000000000): Option<&T>};
        goto -> bb8;
    }

    bb6: {
        _12 = SubUnchecked(copy _11, const 1_usize);
        ((*_1).1: *const T) = copy _12 as *const T (Transmute);
        goto -> bb7;
    }

    bb7: {
        StorageLive(_13);
        _13 = copy _2 as *const T (Transmute);
        _14 = &(*_13);
        StorageDead(_13);
        _0 = Option::<&T>::Some(copy _14);
        goto -> bb8;
    }

    bb8: {
        StorageDead(_14);
        StorageDead(_4);
        StorageDead(_12);
        StorageDead(_11);
        StorageDead(_3);
        StorageDead(_2);
        return;
    }
}