fork/rust

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

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

master
1.3 KiB70 linesraw
1// MIR for `new` after PreCodegen
2
3fn new(_1: Result<T, E>) -> Result<T, E> {
4    debug x => _1;
5    let mut _0: std::result::Result<T, E>;
6    let mut _2: isize;
7    let _3: T;
8    let mut _4: std::ops::ControlFlow<E, T>;
9    let _5: E;
10    let mut _6: isize;
11    let _7: T;
12    let _8: E;
13    scope 1 {
14        debug v => _3;
15    }
16    scope 2 {
17        debug e => _5;
18    }
19    scope 3 {
20        debug v => _7;
21    }
22    scope 4 {
23        debug e => _8;
24    }
25
26    bb0: {
27        StorageLive(_4);
28        _2 = discriminant(_1);
29        switchInt(move _2) -> [0: bb1, 1: bb2, otherwise: bb7];
30    }
31
32    bb1: {
33        _3 = move ((_1 as Ok).0: T);
34        _4 = ControlFlow::<E, T>::Continue(move _3);
35        goto -> bb3;
36    }
37
38    bb2: {
39        _5 = move ((_1 as Err).0: E);
40        _4 = ControlFlow::<E, T>::Break(move _5);
41        goto -> bb3;
42    }
43
44    bb3: {
45        _6 = discriminant(_4);
46        switchInt(move _6) -> [0: bb4, 1: bb5, otherwise: bb7];
47    }
48
49    bb4: {
50        _7 = move ((_4 as Continue).0: T);
51        _0 = Result::<T, E>::Ok(move _7);
52        StorageDead(_4);
53        goto -> bb6;
54    }
55
56    bb5: {
57        _8 = move ((_4 as Break).0: E);
58        _0 = Result::<T, E>::Err(move _8);
59        StorageDead(_4);
60        goto -> bb6;
61    }
62
63    bb6: {
64        return;
65    }
66
67    bb7: {
68        unreachable;
69    }
70}