Skip to content

Commit 7e4cbc4

Browse files
Daniel BloomDaniel-Aaron-Bloom
Daniel Bloom
authored andcommitted
miri fix
1 parent beb8e9e commit 7e4cbc4

6 files changed

+128
-140
lines changed

tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-abort.mir

+39-41
Original file line numberDiff line numberDiff line change
@@ -22,74 +22,74 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
2222
debug i => _33;
2323
debug x => _34;
2424
}
25-
scope 19 (inlined <Enumerate<std::slice::Iter<'_, T>> as Iterator>::next) {
25+
scope 18 (inlined <Enumerate<std::slice::Iter<'_, T>> as Iterator>::next) {
2626
let mut _27: std::option::Option<&T>;
2727
let mut _30: (usize, bool);
2828
let mut _31: (usize, &T);
29-
scope 20 {
29+
scope 19 {
3030
let _29: usize;
31-
scope 25 {
31+
scope 24 {
3232
}
3333
}
34-
scope 21 {
35-
scope 22 {
36-
scope 28 (inlined <Option<(usize, &T)> as FromResidual<Option<Infallible>>>::from_residual) {
34+
scope 20 {
35+
scope 21 {
36+
scope 27 (inlined <Option<(usize, &T)> as FromResidual<Option<Infallible>>>::from_residual) {
3737
}
3838
}
3939
}
40-
scope 23 {
41-
scope 24 {
40+
scope 22 {
41+
scope 23 {
4242
}
4343
}
44-
scope 26 (inlined <Option<&T> as Try>::branch) {
44+
scope 25 (inlined <Option<&T> as Try>::branch) {
4545
let _28: &T;
46-
scope 27 {
46+
scope 26 {
4747
}
4848
}
49-
scope 29 (inlined <std::slice::Iter<'_, T> as Iterator>::next) {
49+
scope 28 (inlined <std::slice::Iter<'_, T> as Iterator>::next) {
5050
let _14: std::ptr::NonNull<T>;
5151
let _16: std::ptr::NonNull<T>;
5252
let mut _19: bool;
5353
let mut _22: std::ptr::NonNull<T>;
5454
let mut _24: usize;
5555
let _26: &T;
56-
scope 30 {
56+
scope 29 {
5757
let _15: *const T;
58-
scope 31 {
58+
scope 30 {
5959
let _23: usize;
60-
scope 32 {
61-
scope 35 (inlined core::num::<impl usize>::unchecked_sub) {
62-
scope 36 (inlined core::ub_checks::check_language_ub) {
63-
scope 37 (inlined core::ub_checks::check_language_ub::runtime) {
60+
scope 31 {
61+
scope 34 (inlined core::num::<impl usize>::unchecked_sub) {
62+
scope 35 (inlined core::ub_checks::check_language_ub) {
63+
scope 36 (inlined core::ub_checks::check_language_ub::runtime) {
6464
}
6565
}
6666
}
67-
scope 38 (inlined without_provenance_mut::<T>) {
67+
scope 37 (inlined without_provenance_mut::<T>) {
6868
}
6969
}
70-
scope 33 (inlined std::ptr::const_ptr::<impl *const T>::addr) {
71-
scope 34 (inlined std::ptr::const_ptr::<impl *const T>::cast::<()>) {
70+
scope 32 (inlined std::ptr::const_ptr::<impl *const T>::addr) {
71+
scope 33 (inlined std::ptr::const_ptr::<impl *const T>::cast::<()>) {
7272
}
7373
}
74-
scope 39 (inlined <NonNull<T> as PartialEq>::eq) {
74+
scope 38 (inlined <NonNull<T> as PartialEq>::eq) {
7575
let mut _17: *mut T;
7676
let mut _18: *mut T;
77-
scope 40 (inlined NonNull::<T>::as_ptr) {
77+
scope 39 (inlined NonNull::<T>::as_ptr) {
7878
}
79-
scope 41 (inlined NonNull::<T>::as_ptr) {
79+
scope 40 (inlined NonNull::<T>::as_ptr) {
8080
}
8181
}
82-
scope 42 (inlined NonNull::<T>::add) {
82+
scope 41 (inlined NonNull::<T>::add) {
8383
let mut _20: *const T;
8484
let mut _21: *const T;
85-
scope 43 (inlined NonNull::<T>::as_ptr) {
85+
scope 42 (inlined NonNull::<T>::as_ptr) {
8686
}
8787
}
88-
scope 44 (inlined NonNull::<T>::as_ref::<'_>) {
88+
scope 43 (inlined NonNull::<T>::as_ref::<'_>) {
8989
let _25: *const T;
90-
scope 45 (inlined NonNull::<T>::as_ptr) {
90+
scope 44 (inlined NonNull::<T>::as_ptr) {
9191
}
92-
scope 46 (inlined std::ptr::mut_ptr::<impl *mut T>::cast_const) {
92+
scope 45 (inlined std::ptr::mut_ptr::<impl *mut T>::cast_const) {
9393
}
9494
}
9595
}
@@ -109,33 +109,31 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
109109
let _9: *const T;
110110
scope 7 {
111111
}
112-
scope 12 (inlined std::ptr::without_provenance::<T>) {
113-
scope 13 (inlined without_provenance_mut::<T>) {
112+
scope 11 (inlined std::ptr::without_provenance::<T>) {
113+
scope 12 (inlined without_provenance_mut::<T>) {
114114
}
115115
}
116-
scope 14 (inlined NonNull::<T>::as_ptr) {
116+
scope 13 (inlined NonNull::<T>::as_ptr) {
117117
}
118-
scope 15 (inlined std::ptr::mut_ptr::<impl *mut T>::add) {
118+
scope 14 (inlined std::ptr::mut_ptr::<impl *mut T>::add) {
119119
}
120120
}
121-
scope 8 (inlined <NonNull<[T]> as From<&[T]>>::from) {
122-
scope 9 (inlined NonNull::<[T]>::from_ref) {
123-
let mut _4: *const [T];
124-
}
121+
scope 8 (inlined NonNull::<[T]>::from_ref) {
122+
let mut _4: *const [T];
125123
}
126-
scope 10 (inlined NonNull::<[T]>::cast::<T>) {
124+
scope 9 (inlined NonNull::<[T]>::cast::<T>) {
127125
let mut _5: *const T;
128-
scope 11 (inlined NonNull::<[T]>::as_ptr) {
126+
scope 10 (inlined NonNull::<[T]>::as_ptr) {
129127
}
130128
}
131129
}
132130
}
133131
}
134-
scope 16 (inlined <std::slice::Iter<'_, T> as Iterator>::enumerate) {
135-
scope 17 (inlined Enumerate::<std::slice::Iter<'_, T>>::new) {
132+
scope 15 (inlined <std::slice::Iter<'_, T> as Iterator>::enumerate) {
133+
scope 16 (inlined Enumerate::<std::slice::Iter<'_, T>>::new) {
136134
}
137135
}
138-
scope 18 (inlined <Enumerate<std::slice::Iter<'_, T>> as IntoIterator>::into_iter) {
136+
scope 17 (inlined <Enumerate<std::slice::Iter<'_, T>> as IntoIterator>::into_iter) {
139137
}
140138

141139
bb0: {

tests/mir-opt/pre-codegen/slice_iter.enumerated_loop.PreCodegen.after.panic-unwind.mir

+11-13
Original file line numberDiff line numberDiff line change
@@ -34,33 +34,31 @@ fn enumerated_loop(_1: &[T], _2: impl Fn(usize, &T)) -> () {
3434
let _9: *const T;
3535
scope 7 {
3636
}
37-
scope 12 (inlined std::ptr::without_provenance::<T>) {
38-
scope 13 (inlined without_provenance_mut::<T>) {
37+
scope 11 (inlined std::ptr::without_provenance::<T>) {
38+
scope 12 (inlined without_provenance_mut::<T>) {
3939
}
4040
}
41-
scope 14 (inlined NonNull::<T>::as_ptr) {
41+
scope 13 (inlined NonNull::<T>::as_ptr) {
4242
}
43-
scope 15 (inlined std::ptr::mut_ptr::<impl *mut T>::add) {
43+
scope 14 (inlined std::ptr::mut_ptr::<impl *mut T>::add) {
4444
}
4545
}
46-
scope 8 (inlined <NonNull<[T]> as From<&[T]>>::from) {
47-
scope 9 (inlined NonNull::<[T]>::from_ref) {
48-
let mut _4: *const [T];
49-
}
46+
scope 8 (inlined NonNull::<[T]>::from_ref) {
47+
let mut _4: *const [T];
5048
}
51-
scope 10 (inlined NonNull::<[T]>::cast::<T>) {
49+
scope 9 (inlined NonNull::<[T]>::cast::<T>) {
5250
let mut _5: *const T;
53-
scope 11 (inlined NonNull::<[T]>::as_ptr) {
51+
scope 10 (inlined NonNull::<[T]>::as_ptr) {
5452
}
5553
}
5654
}
5755
}
5856
}
59-
scope 16 (inlined <std::slice::Iter<'_, T> as Iterator>::enumerate) {
60-
scope 17 (inlined Enumerate::<std::slice::Iter<'_, T>>::new) {
57+
scope 15 (inlined <std::slice::Iter<'_, T> as Iterator>::enumerate) {
58+
scope 16 (inlined Enumerate::<std::slice::Iter<'_, T>>::new) {
6159
}
6260
}
63-
scope 18 (inlined <Enumerate<std::slice::Iter<'_, T>> as IntoIterator>::into_iter) {
61+
scope 17 (inlined <Enumerate<std::slice::Iter<'_, T>> as IntoIterator>::into_iter) {
6462
}
6563

6664
bb0: {

tests/mir-opt/pre-codegen/slice_iter.forward_loop.PreCodegen.after.panic-abort.mir

+27-29
Original file line numberDiff line numberDiff line change
@@ -18,50 +18,50 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () {
1818
scope 2 {
1919
debug x => _27;
2020
}
21-
scope 17 (inlined <std::slice::Iter<'_, T> as Iterator>::next) {
21+
scope 16 (inlined <std::slice::Iter<'_, T> as Iterator>::next) {
2222
let _13: std::ptr::NonNull<T>;
2323
let _15: std::ptr::NonNull<T>;
2424
let mut _18: bool;
2525
let mut _21: std::ptr::NonNull<T>;
2626
let mut _23: usize;
2727
let _25: &T;
28-
scope 18 {
28+
scope 17 {
2929
let _14: *const T;
30-
scope 19 {
30+
scope 18 {
3131
let _22: usize;
32-
scope 20 {
33-
scope 23 (inlined core::num::<impl usize>::unchecked_sub) {
34-
scope 24 (inlined core::ub_checks::check_language_ub) {
35-
scope 25 (inlined core::ub_checks::check_language_ub::runtime) {
32+
scope 19 {
33+
scope 22 (inlined core::num::<impl usize>::unchecked_sub) {
34+
scope 23 (inlined core::ub_checks::check_language_ub) {
35+
scope 24 (inlined core::ub_checks::check_language_ub::runtime) {
3636
}
3737
}
3838
}
39-
scope 26 (inlined without_provenance_mut::<T>) {
39+
scope 25 (inlined without_provenance_mut::<T>) {
4040
}
4141
}
42-
scope 21 (inlined std::ptr::const_ptr::<impl *const T>::addr) {
43-
scope 22 (inlined std::ptr::const_ptr::<impl *const T>::cast::<()>) {
42+
scope 20 (inlined std::ptr::const_ptr::<impl *const T>::addr) {
43+
scope 21 (inlined std::ptr::const_ptr::<impl *const T>::cast::<()>) {
4444
}
4545
}
46-
scope 27 (inlined <NonNull<T> as PartialEq>::eq) {
46+
scope 26 (inlined <NonNull<T> as PartialEq>::eq) {
4747
let mut _16: *mut T;
4848
let mut _17: *mut T;
49-
scope 28 (inlined NonNull::<T>::as_ptr) {
49+
scope 27 (inlined NonNull::<T>::as_ptr) {
5050
}
51-
scope 29 (inlined NonNull::<T>::as_ptr) {
51+
scope 28 (inlined NonNull::<T>::as_ptr) {
5252
}
5353
}
54-
scope 30 (inlined NonNull::<T>::add) {
54+
scope 29 (inlined NonNull::<T>::add) {
5555
let mut _19: *const T;
5656
let mut _20: *const T;
57-
scope 31 (inlined NonNull::<T>::as_ptr) {
57+
scope 30 (inlined NonNull::<T>::as_ptr) {
5858
}
5959
}
60-
scope 32 (inlined NonNull::<T>::as_ref::<'_>) {
60+
scope 31 (inlined NonNull::<T>::as_ref::<'_>) {
6161
let _24: *const T;
62-
scope 33 (inlined NonNull::<T>::as_ptr) {
62+
scope 32 (inlined NonNull::<T>::as_ptr) {
6363
}
64-
scope 34 (inlined std::ptr::mut_ptr::<impl *mut T>::cast_const) {
64+
scope 33 (inlined std::ptr::mut_ptr::<impl *mut T>::cast_const) {
6565
}
6666
}
6767
}
@@ -80,29 +80,27 @@ fn forward_loop(_1: &[T], _2: impl Fn(&T)) -> () {
8080
let _9: *const T;
8181
scope 7 {
8282
}
83-
scope 12 (inlined std::ptr::without_provenance::<T>) {
84-
scope 13 (inlined without_provenance_mut::<T>) {
83+
scope 11 (inlined std::ptr::without_provenance::<T>) {
84+
scope 12 (inlined without_provenance_mut::<T>) {
8585
}
8686
}
87-
scope 14 (inlined NonNull::<T>::as_ptr) {
87+
scope 13 (inlined NonNull::<T>::as_ptr) {
8888
}
89-
scope 15 (inlined std::ptr::mut_ptr::<impl *mut T>::add) {
89+
scope 14 (inlined std::ptr::mut_ptr::<impl *mut T>::add) {
9090
}
9191
}
92-
scope 8 (inlined <NonNull<[T]> as From<&[T]>>::from) {
93-
scope 9 (inlined NonNull::<[T]>::from_ref) {
94-
let mut _4: *const [T];
95-
}
92+
scope 8 (inlined NonNull::<[T]>::from_ref) {
93+
let mut _4: *const [T];
9694
}
97-
scope 10 (inlined NonNull::<[T]>::cast::<T>) {
95+
scope 9 (inlined NonNull::<[T]>::cast::<T>) {
9896
let mut _5: *const T;
99-
scope 11 (inlined NonNull::<[T]>::as_ptr) {
97+
scope 10 (inlined NonNull::<[T]>::as_ptr) {
10098
}
10199
}
102100
}
103101
}
104102
}
105-
scope 16 (inlined <std::slice::Iter<'_, T> as IntoIterator>::into_iter) {
103+
scope 15 (inlined <std::slice::Iter<'_, T> as IntoIterator>::into_iter) {
106104
}
107105

108106
bb0: {

0 commit comments

Comments
 (0)