Skip to content

Commit 667454b

Browse files
committed
Update expected MIR in tests
Updated via `./x.py test mir-opt --bless --stage 1`
1 parent b56c78f commit 667454b

9 files changed

+445
-278
lines changed

tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.32bit.panic-abort.diff

+46-26
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,34 @@
1616
scope 4 (inlined Unique::<[bool; 0]>::dangling) {
1717
let mut _5: std::ptr::NonNull<[bool; 0]>;
1818
scope 5 (inlined NonNull::<[bool; 0]>::dangling) {
19-
let mut _6: std::num::NonZero<usize>;
19+
let _6: std::ptr::Alignment;
20+
let mut _7: std::num::NonZero<usize>;
2021
scope 6 {
21-
scope 8 (inlined std::ptr::Alignment::as_nonzero) {
22+
scope 10 (inlined std::ptr::Alignment::as_nonzero) {
23+
let mut _8: {closure@std::ptr::Alignment::as_nonzero::{closure#0}};
24+
let mut _9: std::num::NonZero<usize>;
25+
scope 11 {
26+
}
27+
scope 12 (inlined core::contracts::build_check_ensures::<NonZero<usize>, {closure@std::ptr::Alignment::as_nonzero::{closure#0}}>) {
28+
}
2229
}
23-
scope 9 (inlined NonNull::<[bool; 0]>::without_provenance) {
24-
let _7: *const [bool; 0];
25-
scope 10 {
30+
scope 13 (inlined NonNull::<[bool; 0]>::without_provenance) {
31+
let _10: *const [bool; 0];
32+
scope 14 {
2633
}
27-
scope 11 (inlined NonZero::<usize>::get) {
34+
scope 15 (inlined NonZero::<usize>::get) {
2835
}
29-
scope 12 (inlined std::ptr::without_provenance::<[bool; 0]>) {
30-
scope 13 (inlined without_provenance_mut::<[bool; 0]>) {
36+
scope 16 (inlined std::ptr::without_provenance::<[bool; 0]>) {
37+
scope 17 (inlined without_provenance_mut::<[bool; 0]>) {
3138
}
3239
}
3340
}
3441
}
3542
scope 7 (inlined std::ptr::Alignment::of::<[bool; 0]>) {
43+
scope 8 {
44+
}
45+
scope 9 (inlined core::contracts::build_check_ensures::<std::ptr::Alignment, {closure@std::ptr::Alignment::of<[bool; 0]>::{closure#0}}>) {
46+
}
3647
}
3748
}
3849
}
@@ -45,33 +56,42 @@
4556
StorageLive(_4);
4657
StorageLive(_5);
4758
StorageLive(_6);
48-
_6 = const NonZero::<usize>(core::num::niche_types::NonZeroUsizeInner(1_usize));
59+
_6 = contract_check_ensures::<{closure@std::ptr::Alignment::of<[bool; 0]>::{closure#0}}, std::ptr::Alignment>(const ZeroSized: {closure@std::ptr::Alignment::of<[bool; 0]>::{closure#0}}, const std::ptr::Alignment::of::<[bool; 0]>::{constant#0}) -> [return: bb2, unwind unreachable];
60+
}
61+
62+
bb1: {
63+
StorageDead(_1);
64+
return;
65+
}
66+
67+
bb2: {
4968
StorageLive(_7);
50-
_7 = const {0x1 as *const [bool; 0]};
51-
_5 = const NonNull::<[bool; 0]> {{ pointer: {0x1 as *const [bool; 0]} }};
69+
StorageLive(_8);
70+
_8 = {closure@$SRC_DIR/core/src/ptr/alignment.rs:LL:COL} { 0: copy _6 };
71+
StorageLive(_9);
72+
_9 = copy _6 as std::num::NonZero<usize> (Transmute);
73+
_7 = contract_check_ensures::<{closure@std::ptr::Alignment::as_nonzero::{closure#0}}, NonZero<usize>>(move _8, move _9) -> [return: bb3, unwind unreachable];
74+
}
75+
76+
bb3: {
77+
StorageDead(_9);
78+
StorageDead(_8);
79+
StorageLive(_10);
80+
_10 = copy _7 as *const [bool; 0] (Transmute);
81+
_5 = NonNull::<[bool; 0]> { pointer: copy _10 };
82+
StorageDead(_10);
5283
StorageDead(_7);
5384
StorageDead(_6);
54-
_4 = const Unique::<[bool; 0]> {{ pointer: NonNull::<[bool; 0]> {{ pointer: {0x1 as *const [bool; 0]} }}, _marker: PhantomData::<[bool; 0]> }};
85+
_4 = Unique::<[bool; 0]> { pointer: move _5, _marker: const PhantomData::<[bool; 0]> };
5586
StorageDead(_5);
56-
_3 = const Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }};
87+
_3 = move _4 as std::ptr::Unique<[bool]> (PointerCoercion(Unsize, Implicit));
5788
StorageDead(_4);
58-
_2 = const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global);
89+
_2 = Box::<[bool]>(copy _3, const std::alloc::Global);
5990
StorageDead(_3);
60-
_1 = const A {{ foo: Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC2, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global) }};
91+
_1 = A { foo: move _2 };
6192
StorageDead(_2);
6293
_0 = const ();
6394
drop(_1) -> [return: bb1, unwind unreachable];
6495
}
65-
66-
bb1: {
67-
StorageDead(_1);
68-
return;
69-
}
7096
}
7197

72-
ALLOC2 (size: 8, align: 4) { .. }
73-
74-
ALLOC1 (size: 8, align: 4) { .. }
75-
76-
ALLOC0 (size: 8, align: 4) { .. }
77-

tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.32bit.panic-unwind.diff

+49-29
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,34 @@
1616
scope 4 (inlined Unique::<[bool; 0]>::dangling) {
1717
let mut _5: std::ptr::NonNull<[bool; 0]>;
1818
scope 5 (inlined NonNull::<[bool; 0]>::dangling) {
19-
let mut _6: std::num::NonZero<usize>;
19+
let _6: std::ptr::Alignment;
20+
let mut _7: std::num::NonZero<usize>;
2021
scope 6 {
21-
scope 8 (inlined std::ptr::Alignment::as_nonzero) {
22+
scope 10 (inlined std::ptr::Alignment::as_nonzero) {
23+
let mut _8: {closure@std::ptr::Alignment::as_nonzero::{closure#0}};
24+
let mut _9: std::num::NonZero<usize>;
25+
scope 11 {
26+
}
27+
scope 12 (inlined core::contracts::build_check_ensures::<NonZero<usize>, {closure@std::ptr::Alignment::as_nonzero::{closure#0}}>) {
28+
}
2229
}
23-
scope 9 (inlined NonNull::<[bool; 0]>::without_provenance) {
24-
let _7: *const [bool; 0];
25-
scope 10 {
30+
scope 13 (inlined NonNull::<[bool; 0]>::without_provenance) {
31+
let _10: *const [bool; 0];
32+
scope 14 {
2633
}
27-
scope 11 (inlined NonZero::<usize>::get) {
34+
scope 15 (inlined NonZero::<usize>::get) {
2835
}
29-
scope 12 (inlined std::ptr::without_provenance::<[bool; 0]>) {
30-
scope 13 (inlined without_provenance_mut::<[bool; 0]>) {
36+
scope 16 (inlined std::ptr::without_provenance::<[bool; 0]>) {
37+
scope 17 (inlined without_provenance_mut::<[bool; 0]>) {
3138
}
3239
}
3340
}
3441
}
3542
scope 7 (inlined std::ptr::Alignment::of::<[bool; 0]>) {
43+
scope 8 {
44+
}
45+
scope 9 (inlined core::contracts::build_check_ensures::<std::ptr::Alignment, {closure@std::ptr::Alignment::of<[bool; 0]>::{closure#0}}>) {
46+
}
3647
}
3748
}
3849
}
@@ -45,22 +56,7 @@
4556
StorageLive(_4);
4657
StorageLive(_5);
4758
StorageLive(_6);
48-
_6 = const NonZero::<usize>(core::num::niche_types::NonZeroUsizeInner(1_usize));
49-
StorageLive(_7);
50-
_7 = const {0x1 as *const [bool; 0]};
51-
_5 = const NonNull::<[bool; 0]> {{ pointer: {0x1 as *const [bool; 0]} }};
52-
StorageDead(_7);
53-
StorageDead(_6);
54-
_4 = const Unique::<[bool; 0]> {{ pointer: NonNull::<[bool; 0]> {{ pointer: {0x1 as *const [bool; 0]} }}, _marker: PhantomData::<[bool; 0]> }};
55-
StorageDead(_5);
56-
_3 = const Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }};
57-
StorageDead(_4);
58-
_2 = const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global);
59-
StorageDead(_3);
60-
_1 = const A {{ foo: Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC2, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global) }};
61-
StorageDead(_2);
62-
_0 = const ();
63-
drop(_1) -> [return: bb1, unwind: bb2];
59+
_6 = contract_check_ensures::<{closure@std::ptr::Alignment::of<[bool; 0]>::{closure#0}}, std::ptr::Alignment>(const ZeroSized: {closure@std::ptr::Alignment::of<[bool; 0]>::{closure#0}}, const std::ptr::Alignment::of::<[bool; 0]>::{constant#0}) -> [return: bb3, unwind continue];
6460
}
6561

6662
bb1: {
@@ -71,11 +67,35 @@
7167
bb2 (cleanup): {
7268
resume;
7369
}
74-
}
7570

76-
ALLOC2 (size: 8, align: 4) { .. }
77-
78-
ALLOC1 (size: 8, align: 4) { .. }
71+
bb3: {
72+
StorageLive(_7);
73+
StorageLive(_8);
74+
_8 = {closure@$SRC_DIR/core/src/ptr/alignment.rs:LL:COL} { 0: copy _6 };
75+
StorageLive(_9);
76+
_9 = copy _6 as std::num::NonZero<usize> (Transmute);
77+
_7 = contract_check_ensures::<{closure@std::ptr::Alignment::as_nonzero::{closure#0}}, NonZero<usize>>(move _8, move _9) -> [return: bb4, unwind continue];
78+
}
7979

80-
ALLOC0 (size: 8, align: 4) { .. }
80+
bb4: {
81+
StorageDead(_9);
82+
StorageDead(_8);
83+
StorageLive(_10);
84+
_10 = copy _7 as *const [bool; 0] (Transmute);
85+
_5 = NonNull::<[bool; 0]> { pointer: copy _10 };
86+
StorageDead(_10);
87+
StorageDead(_7);
88+
StorageDead(_6);
89+
_4 = Unique::<[bool; 0]> { pointer: move _5, _marker: const PhantomData::<[bool; 0]> };
90+
StorageDead(_5);
91+
_3 = move _4 as std::ptr::Unique<[bool]> (PointerCoercion(Unsize, Implicit));
92+
StorageDead(_4);
93+
_2 = Box::<[bool]>(copy _3, const std::alloc::Global);
94+
StorageDead(_3);
95+
_1 = A { foo: move _2 };
96+
StorageDead(_2);
97+
_0 = const ();
98+
drop(_1) -> [return: bb1, unwind: bb2];
99+
}
100+
}
81101

tests/mir-opt/dataflow-const-prop/default_boxed_slice.main.DataflowConstProp.64bit.panic-abort.diff

+46-26
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,34 @@
1616
scope 4 (inlined Unique::<[bool; 0]>::dangling) {
1717
let mut _5: std::ptr::NonNull<[bool; 0]>;
1818
scope 5 (inlined NonNull::<[bool; 0]>::dangling) {
19-
let mut _6: std::num::NonZero<usize>;
19+
let _6: std::ptr::Alignment;
20+
let mut _7: std::num::NonZero<usize>;
2021
scope 6 {
21-
scope 8 (inlined std::ptr::Alignment::as_nonzero) {
22+
scope 10 (inlined std::ptr::Alignment::as_nonzero) {
23+
let mut _8: {closure@std::ptr::Alignment::as_nonzero::{closure#0}};
24+
let mut _9: std::num::NonZero<usize>;
25+
scope 11 {
26+
}
27+
scope 12 (inlined core::contracts::build_check_ensures::<NonZero<usize>, {closure@std::ptr::Alignment::as_nonzero::{closure#0}}>) {
28+
}
2229
}
23-
scope 9 (inlined NonNull::<[bool; 0]>::without_provenance) {
24-
let _7: *const [bool; 0];
25-
scope 10 {
30+
scope 13 (inlined NonNull::<[bool; 0]>::without_provenance) {
31+
let _10: *const [bool; 0];
32+
scope 14 {
2633
}
27-
scope 11 (inlined NonZero::<usize>::get) {
34+
scope 15 (inlined NonZero::<usize>::get) {
2835
}
29-
scope 12 (inlined std::ptr::without_provenance::<[bool; 0]>) {
30-
scope 13 (inlined without_provenance_mut::<[bool; 0]>) {
36+
scope 16 (inlined std::ptr::without_provenance::<[bool; 0]>) {
37+
scope 17 (inlined without_provenance_mut::<[bool; 0]>) {
3138
}
3239
}
3340
}
3441
}
3542
scope 7 (inlined std::ptr::Alignment::of::<[bool; 0]>) {
43+
scope 8 {
44+
}
45+
scope 9 (inlined core::contracts::build_check_ensures::<std::ptr::Alignment, {closure@std::ptr::Alignment::of<[bool; 0]>::{closure#0}}>) {
46+
}
3647
}
3748
}
3849
}
@@ -45,33 +56,42 @@
4556
StorageLive(_4);
4657
StorageLive(_5);
4758
StorageLive(_6);
48-
_6 = const NonZero::<usize>(core::num::niche_types::NonZeroUsizeInner(1_usize));
59+
_6 = contract_check_ensures::<{closure@std::ptr::Alignment::of<[bool; 0]>::{closure#0}}, std::ptr::Alignment>(const ZeroSized: {closure@std::ptr::Alignment::of<[bool; 0]>::{closure#0}}, const std::ptr::Alignment::of::<[bool; 0]>::{constant#0}) -> [return: bb2, unwind unreachable];
60+
}
61+
62+
bb1: {
63+
StorageDead(_1);
64+
return;
65+
}
66+
67+
bb2: {
4968
StorageLive(_7);
50-
_7 = const {0x1 as *const [bool; 0]};
51-
_5 = const NonNull::<[bool; 0]> {{ pointer: {0x1 as *const [bool; 0]} }};
69+
StorageLive(_8);
70+
_8 = {closure@$SRC_DIR/core/src/ptr/alignment.rs:LL:COL} { 0: copy _6 };
71+
StorageLive(_9);
72+
_9 = copy _6 as std::num::NonZero<usize> (Transmute);
73+
_7 = contract_check_ensures::<{closure@std::ptr::Alignment::as_nonzero::{closure#0}}, NonZero<usize>>(move _8, move _9) -> [return: bb3, unwind unreachable];
74+
}
75+
76+
bb3: {
77+
StorageDead(_9);
78+
StorageDead(_8);
79+
StorageLive(_10);
80+
_10 = copy _7 as *const [bool; 0] (Transmute);
81+
_5 = NonNull::<[bool; 0]> { pointer: copy _10 };
82+
StorageDead(_10);
5283
StorageDead(_7);
5384
StorageDead(_6);
54-
_4 = const Unique::<[bool; 0]> {{ pointer: NonNull::<[bool; 0]> {{ pointer: {0x1 as *const [bool; 0]} }}, _marker: PhantomData::<[bool; 0]> }};
85+
_4 = Unique::<[bool; 0]> { pointer: move _5, _marker: const PhantomData::<[bool; 0]> };
5586
StorageDead(_5);
56-
_3 = const Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC0, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }};
87+
_3 = move _4 as std::ptr::Unique<[bool]> (PointerCoercion(Unsize, Implicit));
5788
StorageDead(_4);
58-
_2 = const Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC1, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global);
89+
_2 = Box::<[bool]>(copy _3, const std::alloc::Global);
5990
StorageDead(_3);
60-
_1 = const A {{ foo: Box::<[bool]>(Unique::<[bool]> {{ pointer: NonNull::<[bool]> {{ pointer: Indirect { alloc_id: ALLOC2, offset: Size(0 bytes) }: *const [bool] }}, _marker: PhantomData::<[bool]> }}, std::alloc::Global) }};
91+
_1 = A { foo: move _2 };
6192
StorageDead(_2);
6293
_0 = const ();
6394
drop(_1) -> [return: bb1, unwind unreachable];
6495
}
65-
66-
bb1: {
67-
StorageDead(_1);
68-
return;
69-
}
7096
}
7197

72-
ALLOC2 (size: 16, align: 8) { .. }
73-
74-
ALLOC1 (size: 16, align: 8) { .. }
75-
76-
ALLOC0 (size: 16, align: 8) { .. }
77-

0 commit comments

Comments
 (0)