]> git.lizzy.rs Git - rust.git/blob - tests/mir-opt/try_identity_e2e.new.PreCodegen.after.mir
Rollup merge of #107146 - compiler-errors:unsizing-params, r=cjgillot
[rust.git] / tests / mir-opt / try_identity_e2e.new.PreCodegen.after.mir
1 // MIR for `new` after PreCodegen
2
3 fn new(_1: Result<T, E>) -> Result<T, E> {
4     debug x => _1;                       // in scope 0 at $DIR/try_identity_e2e.rs:+0:14: +0:15
5     let mut _0: std::result::Result<T, E>; // return place in scope 0 at $DIR/try_identity_e2e.rs:+0:34: +0:46
6     let mut _2: std::ops::ControlFlow<E, T>; // in scope 0 at $DIR/try_identity_e2e.rs:+2:15: +7:10
7     let mut _3: isize;                   // in scope 0 at $DIR/try_identity_e2e.rs:+4:17: +4:22
8     let _4: T;                           // in scope 0 at $DIR/try_identity_e2e.rs:+4:20: +4:21
9     let _5: E;                           // in scope 0 at $DIR/try_identity_e2e.rs:+5:21: +5:22
10     let mut _6: isize;                   // in scope 0 at $DIR/try_identity_e2e.rs:+8:13: +8:37
11     let _7: T;                           // in scope 0 at $DIR/try_identity_e2e.rs:+8:35: +8:36
12     let _8: E;                           // in scope 0 at $DIR/try_identity_e2e.rs:+9:32: +9:33
13     scope 1 {
14         debug v => _4;                   // in scope 1 at $DIR/try_identity_e2e.rs:+4:20: +4:21
15     }
16     scope 2 {
17         debug e => _5;                   // in scope 2 at $DIR/try_identity_e2e.rs:+5:21: +5:22
18     }
19     scope 3 {
20         debug v => _7;                   // in scope 3 at $DIR/try_identity_e2e.rs:+8:35: +8:36
21     }
22     scope 4 {
23         debug e => _8;                   // in scope 4 at $DIR/try_identity_e2e.rs:+9:32: +9:33
24     }
25
26     bb0: {
27         StorageLive(_2);                 // scope 0 at $DIR/try_identity_e2e.rs:+2:15: +7:10
28         _3 = discriminant(_1);           // scope 0 at $DIR/try_identity_e2e.rs:+3:19: +3:20
29         switchInt(move _3) -> [0: bb2, 1: bb1, otherwise: bb4]; // scope 0 at $DIR/try_identity_e2e.rs:+3:13: +3:20
30     }
31
32     bb1: {
33         StorageLive(_5);                 // scope 0 at $DIR/try_identity_e2e.rs:+5:21: +5:22
34         _5 = move ((_1 as Err).0: E);    // scope 0 at $DIR/try_identity_e2e.rs:+5:21: +5:22
35         Deinit(_2);                      // scope 2 at $DIR/try_identity_e2e.rs:+5:27: +5:48
36         ((_2 as Break).0: E) = move _5;  // scope 2 at $DIR/try_identity_e2e.rs:+5:27: +5:48
37         discriminant(_2) = 1;            // scope 2 at $DIR/try_identity_e2e.rs:+5:27: +5:48
38         _6 = discriminant(_2);           // scope 0 at $DIR/try_identity_e2e.rs:+2:15: +7:10
39         switchInt(move _6) -> [0: bb5, 1: bb3, otherwise: bb4]; // scope 0 at $DIR/try_identity_e2e.rs:+2:9: +7:10
40     }
41
42     bb2: {
43         StorageLive(_4);                 // scope 0 at $DIR/try_identity_e2e.rs:+4:20: +4:21
44         _4 = move ((_1 as Ok).0: T);     // scope 0 at $DIR/try_identity_e2e.rs:+4:20: +4:21
45         Deinit(_2);                      // scope 1 at $DIR/try_identity_e2e.rs:+4:26: +4:50
46         ((_2 as Continue).0: T) = move _4; // scope 1 at $DIR/try_identity_e2e.rs:+4:26: +4:50
47         discriminant(_2) = 0;            // scope 1 at $DIR/try_identity_e2e.rs:+4:26: +4:50
48         _6 = discriminant(_2);           // scope 0 at $DIR/try_identity_e2e.rs:+2:15: +7:10
49         switchInt(move _6) -> [0: bb5, 1: bb3, otherwise: bb4]; // scope 0 at $DIR/try_identity_e2e.rs:+2:9: +7:10
50     }
51
52     bb3: {
53         StorageLive(_8);                 // scope 0 at $DIR/try_identity_e2e.rs:+9:32: +9:33
54         _8 = move ((_2 as Break).0: E);  // scope 0 at $DIR/try_identity_e2e.rs:+9:32: +9:33
55         Deinit(_0);                      // scope 4 at $DIR/try_identity_e2e.rs:+9:45: +9:51
56         ((_0 as Err).0: E) = move _8;    // scope 4 at $DIR/try_identity_e2e.rs:+9:45: +9:51
57         discriminant(_0) = 1;            // scope 4 at $DIR/try_identity_e2e.rs:+9:45: +9:51
58         StorageDead(_2);                 // scope 0 at $DIR/try_identity_e2e.rs:+12:1: +12:2
59         return;                          // scope 0 at $DIR/try_identity_e2e.rs:+12:1: +12:2
60     }
61
62     bb4: {
63         unreachable;                     // scope 0 at $DIR/try_identity_e2e.rs:+2:15: +7:10
64     }
65
66     bb5: {
67         StorageLive(_7);                 // scope 0 at $DIR/try_identity_e2e.rs:+8:35: +8:36
68         _7 = move ((_2 as Continue).0: T); // scope 0 at $DIR/try_identity_e2e.rs:+8:35: +8:36
69         Deinit(_0);                      // scope 0 at $DIR/try_identity_e2e.rs:+1:5: +11:6
70         ((_0 as Ok).0: T) = move _7;     // scope 0 at $DIR/try_identity_e2e.rs:+1:5: +11:6
71         discriminant(_0) = 0;            // scope 0 at $DIR/try_identity_e2e.rs:+1:5: +11:6
72         StorageDead(_2);                 // scope 0 at $DIR/try_identity_e2e.rs:+12:1: +12:2
73         return;                          // scope 0 at $DIR/try_identity_e2e.rs:+12:1: +12:2
74     }
75 }