
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.4 KiB
Rust
56 lines
3.4 KiB
Rust
// MIR for `ezmap` after PreCodegen
|
|
|
|
fn ezmap(_1: Option<i32>) -> Option<i32> {
|
|
debug x => _1; // in scope 0 at $DIR/simple_option_map.rs:+0:14: +0:15
|
|
let mut _0: std::option::Option<i32>; // return place in scope 0 at $DIR/simple_option_map.rs:+0:33: +0:44
|
|
let mut _5: i32; // in scope 0 at $DIR/simple_option_map.rs:11:25: 11:29
|
|
scope 1 (inlined map::<i32, i32, [closure@$DIR/simple_option_map.rs:18:12: 18:15]>) { // at $DIR/simple_option_map.rs:18:5: 18:22
|
|
debug slf => _1; // in scope 1 at $DIR/simple_option_map.rs:6:17: 6:20
|
|
debug f => const ZeroSized: [closure@$DIR/simple_option_map.rs:18:12: 18:15]; // in scope 1 at $DIR/simple_option_map.rs:6:33: 6:34
|
|
let mut _2: isize; // in scope 1 at $DIR/simple_option_map.rs:11:9: 11:16
|
|
let _3: i32; // in scope 1 at $DIR/simple_option_map.rs:11:14: 11:15
|
|
let mut _4: (i32,); // in scope 1 at $DIR/simple_option_map.rs:11:25: 11:29
|
|
let mut _6: i32; // in scope 1 at $DIR/simple_option_map.rs:11:25: 11:29
|
|
scope 2 {
|
|
debug x => _3; // in scope 2 at $DIR/simple_option_map.rs:11:14: 11:15
|
|
scope 3 (inlined ezmap::{closure#0}) { // at $DIR/simple_option_map.rs:11:25: 11:29
|
|
debug n => _5; // in scope 3 at $DIR/simple_option_map.rs:+1:13: +1:14
|
|
}
|
|
}
|
|
}
|
|
|
|
bb0: {
|
|
StorageLive(_3); // scope 0 at $DIR/simple_option_map.rs:+1:5: +1:22
|
|
_2 = discriminant(_1); // scope 1 at $DIR/simple_option_map.rs:10:11: 10:14
|
|
switchInt(move _2) -> [0: bb1, 1: bb2, otherwise: bb4]; // scope 1 at $DIR/simple_option_map.rs:10:5: 10:14
|
|
}
|
|
|
|
bb1: {
|
|
_0 = Option::<i32>::None; // scope 1 at $DIR/simple_option_map.rs:12:17: 12:21
|
|
goto -> bb3; // scope 1 at $DIR/simple_option_map.rs:12:17: 12:21
|
|
}
|
|
|
|
bb2: {
|
|
_3 = ((_1 as Some).0: i32); // scope 1 at $DIR/simple_option_map.rs:11:14: 11:15
|
|
StorageLive(_6); // scope 2 at $DIR/simple_option_map.rs:11:25: 11:29
|
|
StorageLive(_4); // scope 2 at $DIR/simple_option_map.rs:11:25: 11:29
|
|
_4 = (move _3,); // scope 2 at $DIR/simple_option_map.rs:11:25: 11:29
|
|
StorageLive(_5); // scope 2 at $DIR/simple_option_map.rs:11:25: 11:29
|
|
_5 = move (_4.0: i32); // scope 2 at $DIR/simple_option_map.rs:11:25: 11:29
|
|
_6 = Add(_5, const 1_i32); // scope 3 at $DIR/simple_option_map.rs:+1:16: +1:21
|
|
StorageDead(_5); // scope 2 at $DIR/simple_option_map.rs:11:25: 11:29
|
|
StorageDead(_4); // scope 2 at $DIR/simple_option_map.rs:11:28: 11:29
|
|
_0 = Option::<i32>::Some(move _6); // scope 2 at $DIR/simple_option_map.rs:11:20: 11:30
|
|
StorageDead(_6); // scope 2 at $DIR/simple_option_map.rs:11:29: 11:30
|
|
goto -> bb3; // scope 1 at $DIR/simple_option_map.rs:14:1: 14:2
|
|
}
|
|
|
|
bb3: {
|
|
StorageDead(_3); // scope 0 at $DIR/simple_option_map.rs:+1:5: +1:22
|
|
return; // scope 0 at $DIR/simple_option_map.rs:+2:2: +2:2
|
|
}
|
|
|
|
bb4: {
|
|
unreachable; // scope 1 at $DIR/simple_option_map.rs:10:11: 10:14
|
|
}
|
|
}
|