fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
1.1 KiB48 linesraw
1// MIR for `ezmap` after PreCodegen
2
3fn ezmap(_1: Option<i32>) -> Option<i32> {
4    debug x => _1;
5    let mut _0: std::option::Option<i32>;
6    scope 1 (inlined map::<i32, i32, {closure@$DIR/simple_option_map.rs:17:12: 17:15}>) {
7        debug slf => _1;
8        debug f => const ZeroSized: {closure@$DIR/simple_option_map.rs:17:12: 17:15};
9        let mut _2: isize;
10        let _3: i32;
11        let mut _4: i32;
12        scope 2 {
13            debug x => _3;
14            scope 3 (inlined ezmap::{closure#0}) {
15                debug n => _3;
16            }
17        }
18    }
19
20    bb0: {
21        StorageLive(_2);
22        _2 = discriminant(_1);
23        switchInt(move _2) -> [0: bb1, 1: bb2, otherwise: bb4];
24    }
25
26    bb1: {
27        _0 = Option::<i32>::None;
28        goto -> bb3;
29    }
30
31    bb2: {
32        _3 = ((_1 as Some).0: i32);
33        StorageLive(_4);
34        _4 = Add(_3, const 1_i32);
35        _0 = Option::<i32>::Some(move _4);
36        StorageDead(_4);
37        goto -> bb3;
38    }
39
40    bb3: {
41        StorageDead(_2);
42        return;
43    }
44
45    bb4: {
46        unreachable;
47    }
48}