forked from rust-lang/rust
/
rustc.main.nll.0.mir
170 lines (160 loc) · 11.6 KB
/
rustc.main.nll.0.mir
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
// MIR for `main` 0 nll
| Free Region Mapping
| '_#0r | Global | ['_#0r, '_#1r]
| '_#1r | Local | ['_#1r]
|
| Inferred Region Values
| '_#0r | U0 | {bb0[0..=8], bb1[0], bb2[0..=8], bb3[0], bb4[0..=1], bb5[0..=3], bb6[0..=3], bb7[0..=2], bb8[0..=5], '_#0r, '_#1r}
| '_#1r | U0 | {bb0[0..=8], bb1[0], bb2[0..=8], bb3[0], bb4[0..=1], bb5[0..=3], bb6[0..=3], bb7[0..=2], bb8[0..=5], '_#1r}
| '_#2r | U0 | {bb2[0..=8], bb3[0], bb5[0..=2]}
| '_#3r | U0 | {bb2[1..=8], bb3[0], bb5[0..=2]}
| '_#4r | U0 | {bb2[4..=8], bb3[0], bb5[0..=2]}
|
| Inference Constraints
| '_#0r live at {bb0[0..=8], bb1[0], bb2[0..=8], bb3[0], bb4[0..=1], bb5[0..=3], bb6[0..=3], bb7[0..=2], bb8[0..=5]}
| '_#1r live at {bb0[0..=8], bb1[0], bb2[0..=8], bb3[0], bb4[0..=1], bb5[0..=3], bb6[0..=3], bb7[0..=2], bb8[0..=5]}
| '_#2r live at {bb2[0]}
| '_#3r live at {bb2[1..=3]}
| '_#4r live at {bb2[4..=8], bb3[0], bb5[0..=2]}
| '_#2r: '_#3r due to Assignment at Single(bb2[0])
| '_#3r: '_#4r due to Assignment at Single(bb2[3])
|
fn main() -> () {
let mut _0: (); // return place in scope 0 at $DIR/region-subtyping-basic.rs:14:11: 14:11
let mut _1: [usize; Const { ty: usize, val: Value(Scalar(0x00000003)) }]; // in scope 0 at $DIR/region-subtyping-basic.rs:15:9: 15:14
let _3: usize; // in scope 0 at $DIR/region-subtyping-basic.rs:16:16: 16:17
let mut _4: usize; // in scope 0 at $DIR/region-subtyping-basic.rs:16:14: 16:18
let mut _5: bool; // in scope 0 at $DIR/region-subtyping-basic.rs:16:14: 16:18
let mut _7: bool; // in scope 0 at $DIR/region-subtyping-basic.rs:18:8: 18:12
let _8: bool; // in scope 0 at $DIR/region-subtyping-basic.rs:19:9: 19:18
let mut _9: usize; // in scope 0 at $DIR/region-subtyping-basic.rs:19:15: 19:17
let _10: bool; // in scope 0 at $DIR/region-subtyping-basic.rs:21:9: 21:18
scope 1 {
debug v => _1; // in scope 1 at $DIR/region-subtyping-basic.rs:15:9: 15:14
let _2: &'_#3r usize; // in scope 1 at $DIR/region-subtyping-basic.rs:16:9: 16:10
scope 2 {
debug p => _2; // in scope 2 at $DIR/region-subtyping-basic.rs:16:9: 16:10
let _6: &'_#4r usize; // in scope 2 at $DIR/region-subtyping-basic.rs:17:9: 17:10
scope 3 {
debug q => _6; // in scope 3 at $DIR/region-subtyping-basic.rs:17:9: 17:10
}
}
}
bb0: {
StorageLive(_1); // bb0[0]: scope 0 at $DIR/region-subtyping-basic.rs:15:9: 15:14
_1 = [const Const(Value(Scalar(0x00000001)): usize), const Const(Value(Scalar(0x00000002)): usize), const Const(Value(Scalar(0x00000003)): usize)]; // bb0[1]: scope 0 at $DIR/region-subtyping-basic.rs:15:17: 15:26
// ty::Const
// + ty: usize
// + val: Value(Scalar(0x00000001))
// mir::Constant
// + span: $DIR/region-subtyping-basic.rs:15:18: 15:19
// + literal: Const { ty: usize, val: Value(Scalar(0x00000001)) }
// ty::Const
// + ty: usize
// + val: Value(Scalar(0x00000002))
// mir::Constant
// + span: $DIR/region-subtyping-basic.rs:15:21: 15:22
// + literal: Const { ty: usize, val: Value(Scalar(0x00000002)) }
// ty::Const
// + ty: usize
// + val: Value(Scalar(0x00000003))
// mir::Constant
// + span: $DIR/region-subtyping-basic.rs:15:24: 15:25
// + literal: Const { ty: usize, val: Value(Scalar(0x00000003)) }
FakeRead(ForLet, _1); // bb0[2]: scope 0 at $DIR/region-subtyping-basic.rs:15:9: 15:14
StorageLive(_2); // bb0[3]: scope 1 at $DIR/region-subtyping-basic.rs:16:9: 16:10
StorageLive(_3); // bb0[4]: scope 1 at $DIR/region-subtyping-basic.rs:16:16: 16:17
_3 = const Const(Value(Scalar(0x00000000)): usize); // bb0[5]: scope 1 at $DIR/region-subtyping-basic.rs:16:16: 16:17
// ty::Const
// + ty: usize
// + val: Value(Scalar(0x00000000))
// mir::Constant
// + span: $DIR/region-subtyping-basic.rs:16:16: 16:17
// + literal: Const { ty: usize, val: Value(Scalar(0x00000000)) }
_4 = Len(_1); // bb0[6]: scope 1 at $DIR/region-subtyping-basic.rs:16:14: 16:18
_5 = Lt(_3, _4); // bb0[7]: scope 1 at $DIR/region-subtyping-basic.rs:16:14: 16:18
assert(move _5, "index out of bounds: the len is {} but the index is {}", move _4, _3) -> [success: bb2, unwind: bb1]; // bb0[8]: scope 1 at $DIR/region-subtyping-basic.rs:16:14: 16:18
}
bb1 (cleanup): {
resume; // bb1[0]: scope 0 at $DIR/region-subtyping-basic.rs:14:1: 23:2
}
bb2: {
_2 = &'_#2r _1[_3]; // bb2[0]: scope 1 at $DIR/region-subtyping-basic.rs:16:13: 16:18
FakeRead(ForLet, _2); // bb2[1]: scope 1 at $DIR/region-subtyping-basic.rs:16:9: 16:10
StorageLive(_6); // bb2[2]: scope 2 at $DIR/region-subtyping-basic.rs:17:9: 17:10
_6 = _2; // bb2[3]: scope 2 at $DIR/region-subtyping-basic.rs:17:13: 17:14
FakeRead(ForLet, _6); // bb2[4]: scope 2 at $DIR/region-subtyping-basic.rs:17:9: 17:10
StorageLive(_7); // bb2[5]: scope 3 at $DIR/region-subtyping-basic.rs:18:8: 18:12
_7 = const Const(Value(Scalar(0x01)): bool); // bb2[6]: scope 3 at $DIR/region-subtyping-basic.rs:18:8: 18:12
// ty::Const
// + ty: bool
// + val: Value(Scalar(0x01))
// mir::Constant
// + span: $DIR/region-subtyping-basic.rs:18:8: 18:12
// + literal: Const { ty: bool, val: Value(Scalar(0x01)) }
FakeRead(ForMatchedPlace, _7); // bb2[7]: scope 3 at $DIR/region-subtyping-basic.rs:18:8: 18:12
switchInt(_7) -> [Const(Value(Scalar(0x00)): bool): bb4, otherwise: bb3]; // bb2[8]: scope 3 at $DIR/region-subtyping-basic.rs:18:5: 22:6
}
bb3: {
falseEdges -> [real: bb5, imaginary: bb4]; // bb3[0]: scope 3 at $DIR/region-subtyping-basic.rs:18:5: 22:6
}
bb4: {
StorageLive(_10); // bb4[0]: scope 3 at $DIR/region-subtyping-basic.rs:21:9: 21:18
_10 = const Const(Value(Scalar(<ZST>)): fn(usize) -> bool {use_x})(const Const(Value(Scalar(0x00000016)): usize)) -> [return: bb7, unwind: bb1]; // bb4[1]: scope 3 at $DIR/region-subtyping-basic.rs:21:9: 21:18
// ty::Const
// + ty: fn(usize) -> bool {use_x}
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/region-subtyping-basic.rs:21:9: 21:14
// + literal: Const { ty: fn(usize) -> bool {use_x}, val: Value(Scalar(<ZST>)) }
// ty::Const
// + ty: usize
// + val: Value(Scalar(0x00000016))
// mir::Constant
// + span: $DIR/region-subtyping-basic.rs:21:15: 21:17
// + literal: Const { ty: usize, val: Value(Scalar(0x00000016)) }
}
bb5: {
StorageLive(_8); // bb5[0]: scope 3 at $DIR/region-subtyping-basic.rs:19:9: 19:18
StorageLive(_9); // bb5[1]: scope 3 at $DIR/region-subtyping-basic.rs:19:15: 19:17
_9 = (*_6); // bb5[2]: scope 3 at $DIR/region-subtyping-basic.rs:19:15: 19:17
_8 = const Const(Value(Scalar(<ZST>)): fn(usize) -> bool {use_x})(move _9) -> [return: bb6, unwind: bb1]; // bb5[3]: scope 3 at $DIR/region-subtyping-basic.rs:19:9: 19:18
// ty::Const
// + ty: fn(usize) -> bool {use_x}
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/region-subtyping-basic.rs:19:9: 19:14
// + literal: Const { ty: fn(usize) -> bool {use_x}, val: Value(Scalar(<ZST>)) }
}
bb6: {
StorageDead(_9); // bb6[0]: scope 3 at $DIR/region-subtyping-basic.rs:19:17: 19:18
StorageDead(_8); // bb6[1]: scope 3 at $DIR/region-subtyping-basic.rs:19:18: 19:19
_0 = const Const(Value(Scalar(<ZST>)): ()); // bb6[2]: scope 3 at $DIR/region-subtyping-basic.rs:18:13: 20:6
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/region-subtyping-basic.rs:18:13: 20:6
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
goto -> bb8; // bb6[3]: scope 3 at $DIR/region-subtyping-basic.rs:18:5: 22:6
}
bb7: {
StorageDead(_10); // bb7[0]: scope 3 at $DIR/region-subtyping-basic.rs:21:18: 21:19
_0 = const Const(Value(Scalar(<ZST>)): ()); // bb7[1]: scope 3 at $DIR/region-subtyping-basic.rs:20:12: 22:6
// ty::Const
// + ty: ()
// + val: Value(Scalar(<ZST>))
// mir::Constant
// + span: $DIR/region-subtyping-basic.rs:20:12: 22:6
// + literal: Const { ty: (), val: Value(Scalar(<ZST>)) }
goto -> bb8; // bb7[2]: scope 3 at $DIR/region-subtyping-basic.rs:18:5: 22:6
}
bb8: {
StorageDead(_6); // bb8[0]: scope 2 at $DIR/region-subtyping-basic.rs:23:1: 23:2
StorageDead(_3); // bb8[1]: scope 1 at $DIR/region-subtyping-basic.rs:23:1: 23:2
StorageDead(_2); // bb8[2]: scope 1 at $DIR/region-subtyping-basic.rs:23:1: 23:2
StorageDead(_1); // bb8[3]: scope 0 at $DIR/region-subtyping-basic.rs:23:1: 23:2
StorageDead(_7); // bb8[4]: scope 0 at $DIR/region-subtyping-basic.rs:23:1: 23:2
return; // bb8[5]: scope 0 at $DIR/region-subtyping-basic.rs:23:2: 23:2
}
}