]> git.proxmox.com Git - rustc.git/blob - tests/mir-opt/retag.array_casts.SimplifyCfg-elaborate-drops.after.panic-unwind.mir
New upstream version 1.74.1+dfsg1
[rustc.git] / tests / mir-opt / retag.array_casts.SimplifyCfg-elaborate-drops.after.panic-unwind.mir
1 // MIR for `array_casts` after SimplifyCfg-elaborate-drops
2
3 fn array_casts() -> () {
4 let mut _0: ();
5 let mut _1: [usize; 2];
6 let mut _3: *mut [usize; 2];
7 let mut _4: &mut [usize; 2];
8 let _5: ();
9 let mut _6: *mut usize;
10 let mut _7: *mut usize;
11 let mut _10: *const [usize; 2];
12 let _11: &[usize; 2];
13 let _12: ();
14 let mut _13: (&usize, &usize);
15 let mut _14: &usize;
16 let _15: usize;
17 let mut _16: *const usize;
18 let mut _17: *const usize;
19 let mut _18: &usize;
20 let _19: usize;
21 let mut _22: bool;
22 let mut _23: usize;
23 let mut _24: usize;
24 let mut _25: !;
25 let _27: !;
26 let mut _28: core::panicking::AssertKind;
27 let mut _29: &usize;
28 let _30: &usize;
29 let mut _31: &usize;
30 let _32: &usize;
31 let mut _33: std::option::Option<std::fmt::Arguments<'_>>;
32 scope 1 {
33 debug x => _1;
34 let _2: *mut usize;
35 scope 2 {
36 debug p => _2;
37 let _8: [usize; 2];
38 scope 3 {
39 }
40 scope 4 {
41 debug x => _8;
42 let _9: *const usize;
43 scope 5 {
44 debug p => _9;
45 let _20: &usize;
46 let _21: &usize;
47 let mut _34: &usize;
48 scope 6 {
49 }
50 scope 7 {
51 debug left_val => _20;
52 debug right_val => _21;
53 let _26: core::panicking::AssertKind;
54 scope 8 {
55 debug kind => _26;
56 }
57 }
58 }
59 }
60 }
61 }
62
63 bb0: {
64 StorageLive(_1);
65 _1 = [const 0_usize, const 0_usize];
66 StorageLive(_2);
67 StorageLive(_3);
68 StorageLive(_4);
69 _4 = &mut _1;
70 _3 = &raw mut (*_4);
71 _2 = move _3 as *mut usize (PointerCoercion(ArrayToPointer));
72 StorageDead(_3);
73 StorageDead(_4);
74 StorageLive(_5);
75 StorageLive(_6);
76 StorageLive(_7);
77 _7 = _2;
78 _6 = ptr::mut_ptr::<impl *mut usize>::add(move _7, const 1_usize) -> [return: bb1, unwind continue];
79 }
80
81 bb1: {
82 StorageDead(_7);
83 (*_6) = const 1_usize;
84 StorageDead(_6);
85 _5 = const ();
86 StorageDead(_5);
87 StorageLive(_8);
88 _8 = [const 0_usize, const 1_usize];
89 StorageLive(_9);
90 StorageLive(_10);
91 StorageLive(_11);
92 _11 = &_8;
93 _10 = &raw const (*_11);
94 _9 = move _10 as *const usize (PointerCoercion(ArrayToPointer));
95 StorageDead(_10);
96 StorageDead(_11);
97 StorageLive(_12);
98 StorageLive(_13);
99 StorageLive(_14);
100 StorageLive(_15);
101 StorageLive(_16);
102 StorageLive(_17);
103 _17 = _9;
104 _16 = ptr::const_ptr::<impl *const usize>::add(move _17, const 1_usize) -> [return: bb2, unwind continue];
105 }
106
107 bb2: {
108 StorageDead(_17);
109 _15 = (*_16);
110 _14 = &_15;
111 StorageLive(_18);
112 _34 = const _;
113 Retag(_34);
114 _18 = &(*_34);
115 _13 = (move _14, move _18);
116 Retag(_13);
117 StorageDead(_18);
118 StorageDead(_14);
119 StorageLive(_20);
120 _20 = (_13.0: &usize);
121 Retag(_20);
122 StorageLive(_21);
123 _21 = (_13.1: &usize);
124 Retag(_21);
125 StorageLive(_22);
126 StorageLive(_23);
127 _23 = (*_20);
128 StorageLive(_24);
129 _24 = (*_21);
130 _22 = Eq(move _23, move _24);
131 switchInt(move _22) -> [0: bb4, otherwise: bb3];
132 }
133
134 bb3: {
135 StorageDead(_24);
136 StorageDead(_23);
137 _12 = const ();
138 StorageDead(_22);
139 StorageDead(_21);
140 StorageDead(_20);
141 StorageDead(_16);
142 StorageDead(_15);
143 StorageDead(_13);
144 StorageDead(_12);
145 _0 = const ();
146 StorageDead(_9);
147 StorageDead(_8);
148 StorageDead(_2);
149 StorageDead(_1);
150 return;
151 }
152
153 bb4: {
154 StorageDead(_24);
155 StorageDead(_23);
156 StorageLive(_26);
157 _26 = core::panicking::AssertKind::Eq;
158 StorageLive(_27);
159 StorageLive(_28);
160 _28 = move _26;
161 StorageLive(_29);
162 StorageLive(_30);
163 _30 = &(*_20);
164 _29 = &(*_30);
165 StorageLive(_31);
166 StorageLive(_32);
167 _32 = &(*_21);
168 _31 = &(*_32);
169 StorageLive(_33);
170 _33 = Option::<Arguments<'_>>::None;
171 Retag(_33);
172 _27 = core::panicking::assert_failed::<usize, usize>(move _28, move _29, move _31, move _33) -> unwind continue;
173 }
174 }