d69725d5d5
Since this only affects `PreCodegen MIR, and it would be nice for that to be resilient to permutations of things that don't affect the actual semantic behaviours.
56 lines
3.0 KiB
Diff
56 lines
3.0 KiB
Diff
- // MIR for `outer` before Inline
|
|
+ // MIR for `outer` after Inline
|
|
|
|
fn outer() -> usize {
|
|
let mut _0: usize; // return place in scope 0 at $DIR/issue_106141.rs:+0:19: +0:24
|
|
+ scope 1 (inlined inner) { // at $DIR/issue_106141.rs:3:5: 3:12
|
|
+ let mut _1: &[bool; 1]; // in scope 1 at $DIR/issue_106141.rs:12:18: 12:25
|
|
+ let mut _2: bool; // in scope 1 at $DIR/issue_106141.rs:14:8: 14:21
|
|
+ let mut _3: bool; // in scope 1 at $DIR/issue_106141.rs:14:8: 14:21
|
|
+ scope 2 {
|
|
+ debug buffer => const _; // in scope 2 at $DIR/issue_106141.rs:12:9: 12:15
|
|
+ scope 3 {
|
|
+ debug index => _0; // in scope 3 at $DIR/issue_106141.rs:13:9: 13:14
|
|
+ }
|
|
+ }
|
|
+ }
|
|
|
|
bb0: {
|
|
- _0 = inner() -> bb1; // scope 0 at $DIR/issue_106141.rs:+1:5: +1:12
|
|
+ StorageLive(_1); // scope 0 at $DIR/issue_106141.rs:+1:5: +1:12
|
|
+ _1 = const _; // scope 1 at $DIR/issue_106141.rs:12:18: 12:25
|
|
// mir::Constant
|
|
- // + span: $DIR/issue_106141.rs:3:5: 3:10
|
|
- // + literal: Const { ty: fn() -> usize {inner}, val: Value(<ZST>) }
|
|
+ // + span: $DIR/issue_106141.rs:12:18: 12:25
|
|
+ // + literal: Const { ty: &[bool; 1], val: Unevaluated(inner, [], Some(promoted[0])) }
|
|
+ _0 = index() -> bb1; // scope 2 at $DIR/issue_106141.rs:13:17: 13:24
|
|
+ // mir::Constant
|
|
+ // + span: $DIR/issue_106141.rs:13:17: 13:22
|
|
+ // + literal: Const { ty: fn() -> usize {index}, val: Value(<ZST>) }
|
|
}
|
|
|
|
bb1: {
|
|
+ StorageLive(_3); // scope 3 at $DIR/issue_106141.rs:14:8: 14:21
|
|
+ _2 = Lt(_0, const 1_usize); // scope 3 at $DIR/issue_106141.rs:14:8: 14:21
|
|
+ assert(move _2, "index out of bounds: the length is {} but the index is {}", const 1_usize, _0) -> bb2; // scope 3 at $DIR/issue_106141.rs:14:8: 14:21
|
|
+ }
|
|
+
|
|
+ bb2: {
|
|
+ _3 = (*_1)[_0]; // scope 3 at $DIR/issue_106141.rs:14:8: 14:21
|
|
+ switchInt(move _3) -> [0: bb3, otherwise: bb4]; // scope 3 at $DIR/issue_106141.rs:14:8: 14:21
|
|
+ }
|
|
+
|
|
+ bb3: {
|
|
+ _0 = const 0_usize; // scope 3 at $DIR/issue_106141.rs:17:9: 17:10
|
|
+ goto -> bb4; // scope 3 at $DIR/issue_106141.rs:14:5: 18:6
|
|
+ }
|
|
+
|
|
+ bb4: {
|
|
+ StorageDead(_3); // scope 3 at $DIR/issue_106141.rs:18:5: 18:6
|
|
+ StorageDead(_1); // scope 0 at $DIR/issue_106141.rs:+1:5: +1:12
|
|
return; // scope 0 at $DIR/issue_106141.rs:+2:2: +2:2
|
|
}
|
|
}
|
|
|