]> git.proxmox.com Git - rustc.git/blame - src/test/mir-opt/inline/inline_generator.main.Inline.diff
New upstream version 1.63.0+dfsg1
[rustc.git] / src / test / mir-opt / inline / inline_generator.main.Inline.diff
CommitLineData
fc512014
XL
1- // MIR for `main` before Inline
2+ // MIR for `main` after Inline
3
4 fn main() -> () {
5 let mut _0: (); // return place in scope 0 at $DIR/inline-generator.rs:8:11: 8:11
3c0e092e
XL
6 let _1: std::ops::GeneratorState<i32, bool>; // in scope 0 at $DIR/inline-generator.rs:9:9: 9:11
7 let mut _2: std::pin::Pin<&mut [generator@$DIR/inline-generator.rs:15:5: 15:41]>; // in scope 0 at $DIR/inline-generator.rs:9:14: 9:32
8 let mut _3: &mut [generator@$DIR/inline-generator.rs:15:5: 15:41]; // in scope 0 at $DIR/inline-generator.rs:9:23: 9:31
9 let mut _4: [generator@$DIR/inline-generator.rs:15:5: 15:41]; // in scope 0 at $DIR/inline-generator.rs:9:28: 9:31
fc512014
XL
10+ let mut _7: bool; // in scope 0 at $DIR/inline-generator.rs:9:14: 9:46
11 scope 1 {
12 debug _r => _1; // in scope 1 at $DIR/inline-generator.rs:9:9: 9:11
13 }
14+ scope 2 (inlined g) { // at $DIR/inline-generator.rs:9:28: 9:31
15+ }
136023e0 16+ scope 3 (inlined Pin::<&mut [generator@$DIR/inline-generator.rs:15:5: 15:41]>::new) { // at $DIR/inline-generator.rs:9:14: 9:32
5e7ed085
FG
17+ debug pointer => _3; // in scope 3 at $SRC_DIR/core/src/pin.rs:LL:COL
18+ let mut _5: &mut [generator@$DIR/inline-generator.rs:15:5: 15:41]; // in scope 3 at $SRC_DIR/core/src/pin.rs:LL:COL
fc512014 19+ scope 4 {
5e7ed085
FG
20+ scope 5 (inlined Pin::<&mut [generator@$DIR/inline-generator.rs:15:5: 15:41]>::new_unchecked) { // at $SRC_DIR/core/src/pin.rs:LL:COL
21+ debug pointer => _5; // in scope 5 at $SRC_DIR/core/src/pin.rs:LL:COL
22+ let mut _6: &mut [generator@$DIR/inline-generator.rs:15:5: 15:41]; // in scope 5 at $SRC_DIR/core/src/pin.rs:LL:COL
fc512014
XL
23+ }
24+ }
25+ }
26+ scope 6 (inlined g::{closure#0}) { // at $DIR/inline-generator.rs:9:14: 9:46
5e7ed085
FG
27+ debug a => _11; // in scope 6 at $DIR/inline-generator.rs:15:6: 15:7
28+ let mut _8: i32; // in scope 6 at $DIR/inline-generator.rs:15:17: 15:39
29+ let mut _9: bool; // in scope 6 at $DIR/inline-generator.rs:15:20: 15:21
30+ let mut _10: bool; // in scope 6 at $DIR/inline-generator.rs:15:9: 15:9
31+ let _11: bool; // in scope 6 at $DIR/inline-generator.rs:15:6: 15:7
32+ let mut _12: u32; // in scope 6 at $DIR/inline-generator.rs:15:5: 15:41
923072b8
FG
33+ let mut _13: &mut [generator@$DIR/inline-generator.rs:15:5: 15:41]; // in scope 6 at $DIR/inline-generator.rs:15:5: 15:41
34+ let mut _14: &mut [generator@$DIR/inline-generator.rs:15:5: 15:41]; // in scope 6 at $DIR/inline-generator.rs:15:5: 15:41
35+ let mut _15: &mut [generator@$DIR/inline-generator.rs:15:5: 15:41]; // in scope 6 at $DIR/inline-generator.rs:15:5: 15:41
fc512014
XL
36+ }
37
38 bb0: {
39 StorageLive(_1); // scope 0 at $DIR/inline-generator.rs:9:9: 9:11
40 StorageLive(_2); // scope 0 at $DIR/inline-generator.rs:9:14: 9:32
41 StorageLive(_3); // scope 0 at $DIR/inline-generator.rs:9:23: 9:31
42 StorageLive(_4); // scope 0 at $DIR/inline-generator.rs:9:28: 9:31
43- _4 = g() -> bb1; // scope 0 at $DIR/inline-generator.rs:9:28: 9:31
44- // mir::Constant
45- // + span: $DIR/inline-generator.rs:9:28: 9:29
5e7ed085 46- // + literal: Const { ty: fn() -> impl Generator<bool> {g}, val: Value(Scalar(<ZST>)) }
fc512014
XL
47- }
48-
49- bb1: {
04454e1e 50+ Deinit(_4); // scope 2 at $DIR/inline-generator.rs:15:5: 15:41
5e7ed085 51+ discriminant(_4) = 0; // scope 2 at $DIR/inline-generator.rs:15:5: 15:41
fc512014 52 _3 = &mut _4; // scope 0 at $DIR/inline-generator.rs:9:23: 9:31
5e7ed085 53- _2 = Pin::<&mut [generator@$DIR/inline-generator.rs:15:5: 15:41]>::new(move _3) -> [return: bb2, unwind: bb4]; // scope 0 at $DIR/inline-generator.rs:9:14: 9:32
fc512014
XL
54- // mir::Constant
55- // + span: $DIR/inline-generator.rs:9:14: 9:22
56- // + user_ty: UserType(0)
5e7ed085 57- // + literal: Const { ty: fn(&mut [generator@$DIR/inline-generator.rs:15:5: 15:41]) -> Pin<&mut [generator@$DIR/inline-generator.rs:15:5: 15:41]> {Pin::<&mut [generator@$DIR/inline-generator.rs:15:5: 15:41]>::new}, val: Value(Scalar(<ZST>)) }
fc512014
XL
58- }
59-
60- bb2: {
5e7ed085
FG
61+ StorageLive(_5); // scope 4 at $SRC_DIR/core/src/pin.rs:LL:COL
62+ _5 = move _3; // scope 4 at $SRC_DIR/core/src/pin.rs:LL:COL
63+ StorageLive(_6); // scope 5 at $SRC_DIR/core/src/pin.rs:LL:COL
64+ _6 = move _5; // scope 5 at $SRC_DIR/core/src/pin.rs:LL:COL
04454e1e 65+ Deinit(_2); // scope 5 at $SRC_DIR/core/src/pin.rs:LL:COL
5e7ed085
FG
66+ (_2.0: &mut [generator@$DIR/inline-generator.rs:15:5: 15:41]) = move _6; // scope 5 at $SRC_DIR/core/src/pin.rs:LL:COL
67+ StorageDead(_6); // scope 5 at $SRC_DIR/core/src/pin.rs:LL:COL
68+ StorageDead(_5); // scope 4 at $SRC_DIR/core/src/pin.rs:LL:COL
fc512014 69 StorageDead(_3); // scope 0 at $DIR/inline-generator.rs:9:31: 9:32
5e7ed085 70- _1 = <[generator@$DIR/inline-generator.rs:15:5: 15:41] as Generator<bool>>::resume(move _2, const false) -> [return: bb3, unwind: bb4]; // scope 0 at $DIR/inline-generator.rs:9:14: 9:46
fc512014
XL
71- // mir::Constant
72- // + span: $DIR/inline-generator.rs:9:33: 9:39
5e7ed085 73- // + literal: Const { ty: for<'r> fn(Pin<&'r mut [generator@$DIR/inline-generator.rs:15:5: 15:41]>, bool) -> GeneratorState<<[generator@$DIR/inline-generator.rs:15:5: 15:41] as Generator<bool>>::Yield, <[generator@$DIR/inline-generator.rs:15:5: 15:41] as Generator<bool>>::Return> {<[generator@$DIR/inline-generator.rs:15:5: 15:41] as Generator<bool>>::resume}, val: Value(Scalar(<ZST>)) }
fc512014
XL
74+ StorageLive(_7); // scope 0 at $DIR/inline-generator.rs:9:14: 9:46
75+ _7 = const false; // scope 0 at $DIR/inline-generator.rs:9:14: 9:46
6a06907d
XL
76+ StorageLive(_10); // scope 0 at $DIR/inline-generator.rs:9:14: 9:46
77+ StorageLive(_11); // scope 0 at $DIR/inline-generator.rs:9:14: 9:46
78+ StorageLive(_12); // scope 0 at $DIR/inline-generator.rs:9:14: 9:46
923072b8
FG
79+ StorageLive(_13); // scope 6 at $DIR/inline-generator.rs:15:5: 15:41
80+ _13 = move (_2.0: &mut [generator@$DIR/inline-generator.rs:15:5: 15:41]); // scope 6 at $DIR/inline-generator.rs:15:5: 15:41
81+ _12 = discriminant((*_13)); // scope 6 at $DIR/inline-generator.rs:15:5: 15:41
82+ StorageDead(_13); // scope 6 at $DIR/inline-generator.rs:15:5: 15:41
5e7ed085 83+ switchInt(move _12) -> [0_u32: bb3, 1_u32: bb8, 3_u32: bb7, otherwise: bb9]; // scope 6 at $DIR/inline-generator.rs:15:5: 15:41
fc512014
XL
84 }
85
86- bb3: {
87+ bb1: {
6a06907d
XL
88+ StorageDead(_12); // scope 0 at $DIR/inline-generator.rs:9:14: 9:46
89+ StorageDead(_11); // scope 0 at $DIR/inline-generator.rs:9:14: 9:46
90+ StorageDead(_10); // scope 0 at $DIR/inline-generator.rs:9:14: 9:46
fc512014
XL
91+ StorageDead(_7); // scope 0 at $DIR/inline-generator.rs:9:14: 9:46
92 StorageDead(_2); // scope 0 at $DIR/inline-generator.rs:9:45: 9:46
93 StorageDead(_4); // scope 0 at $DIR/inline-generator.rs:9:46: 9:47
94 _0 = const (); // scope 0 at $DIR/inline-generator.rs:8:11: 10:2
95 StorageDead(_1); // scope 0 at $DIR/inline-generator.rs:10:1: 10:2
96 return; // scope 0 at $DIR/inline-generator.rs:10:2: 10:2
97 }
98
99- bb4 (cleanup): {
100+ bb2 (cleanup): {
101 resume; // scope 0 at $DIR/inline-generator.rs:8:1: 10:2
102+ }
103+
104+ bb3: {
5e7ed085
FG
105+ _11 = move _7; // scope 6 at $DIR/inline-generator.rs:15:5: 15:41
106+ StorageLive(_8); // scope 6 at $DIR/inline-generator.rs:15:17: 15:39
107+ StorageLive(_9); // scope 6 at $DIR/inline-generator.rs:15:20: 15:21
108+ _9 = _11; // scope 6 at $DIR/inline-generator.rs:15:20: 15:21
109+ switchInt(move _9) -> [false: bb5, otherwise: bb4]; // scope 6 at $DIR/inline-generator.rs:15:20: 15:21
fc512014
XL
110+ }
111+
112+ bb4: {
5e7ed085
FG
113+ _8 = const 7_i32; // scope 6 at $DIR/inline-generator.rs:15:24: 15:25
114+ goto -> bb6; // scope 6 at $DIR/inline-generator.rs:15:17: 15:39
fc512014
XL
115+ }
116+
117+ bb5: {
5e7ed085
FG
118+ _8 = const 13_i32; // scope 6 at $DIR/inline-generator.rs:15:35: 15:37
119+ goto -> bb6; // scope 6 at $DIR/inline-generator.rs:15:17: 15:39
fc512014
XL
120+ }
121+
122+ bb6: {
5e7ed085 123+ StorageDead(_9); // scope 6 at $DIR/inline-generator.rs:15:38: 15:39
04454e1e 124+ Deinit(_1); // scope 6 at $DIR/inline-generator.rs:15:11: 15:39
5e7ed085
FG
125+ ((_1 as Yielded).0: i32) = move _8; // scope 6 at $DIR/inline-generator.rs:15:11: 15:39
126+ discriminant(_1) = 0; // scope 6 at $DIR/inline-generator.rs:15:11: 15:39
923072b8
FG
127+ StorageLive(_14); // scope 6 at $DIR/inline-generator.rs:15:11: 15:39
128+ _14 = move (_2.0: &mut [generator@$DIR/inline-generator.rs:15:5: 15:41]); // scope 6 at $DIR/inline-generator.rs:15:11: 15:39
129+ discriminant((*_14)) = 3; // scope 6 at $DIR/inline-generator.rs:15:11: 15:39
130+ StorageDead(_14); // scope 6 at $DIR/inline-generator.rs:15:11: 15:39
fc512014
XL
131+ goto -> bb1; // scope 0 at $DIR/inline-generator.rs:15:11: 15:39
132+ }
133+
134+ bb7: {
5e7ed085
FG
135+ StorageLive(_8); // scope 6 at $DIR/inline-generator.rs:15:5: 15:41
136+ _10 = move _7; // scope 6 at $DIR/inline-generator.rs:15:5: 15:41
137+ StorageDead(_8); // scope 6 at $DIR/inline-generator.rs:15:38: 15:39
04454e1e 138+ Deinit(_1); // scope 6 at $DIR/inline-generator.rs:15:41: 15:41
5e7ed085
FG
139+ ((_1 as Complete).0: bool) = move _10; // scope 6 at $DIR/inline-generator.rs:15:41: 15:41
140+ discriminant(_1) = 1; // scope 6 at $DIR/inline-generator.rs:15:41: 15:41
923072b8
FG
141+ StorageLive(_15); // scope 6 at $DIR/inline-generator.rs:15:41: 15:41
142+ _15 = move (_2.0: &mut [generator@$DIR/inline-generator.rs:15:5: 15:41]); // scope 6 at $DIR/inline-generator.rs:15:41: 15:41
143+ discriminant((*_15)) = 1; // scope 6 at $DIR/inline-generator.rs:15:41: 15:41
144+ StorageDead(_15); // scope 6 at $DIR/inline-generator.rs:15:41: 15:41
fc512014
XL
145+ goto -> bb1; // scope 0 at $DIR/inline-generator.rs:15:41: 15:41
146+ }
147+
148+ bb8: {
5e7ed085 149+ assert(const false, "generator resumed after completion") -> [success: bb8, unwind: bb2]; // scope 6 at $DIR/inline-generator.rs:15:5: 15:41
fc512014
XL
150+ }
151+
152+ bb9: {
5e7ed085 153+ unreachable; // scope 6 at $DIR/inline-generator.rs:15:5: 15:41
fc512014
XL
154 }
155 }
156