]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/try_identity_e2e.new.PreCodegen.after.mir
Add #[const_trait] where needed in tests.
[rust.git] / src / test / 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: T;                       // in scope 0 at $DIR/try_identity_e2e.rs:+2:9: +10:10
7     let mut _3: std::ops::ControlFlow<E, T>; // in scope 0 at $DIR/try_identity_e2e.rs:+2:15: +7:10
8     let mut _4: isize;                   // in scope 0 at $DIR/try_identity_e2e.rs:+4:17: +4:22
9     let _5: T;                           // in scope 0 at $DIR/try_identity_e2e.rs:+4:20: +4:21
10     let mut _6: T;                       // in scope 0 at $DIR/try_identity_e2e.rs:+4:48: +4:49
11     let _7: E;                           // in scope 0 at $DIR/try_identity_e2e.rs:+5:21: +5:22
12     let mut _8: E;                       // in scope 0 at $DIR/try_identity_e2e.rs:+5:46: +5:47
13     let mut _9: isize;                   // in scope 0 at $DIR/try_identity_e2e.rs:+8:13: +8:37
14     let _10: T;                          // in scope 0 at $DIR/try_identity_e2e.rs:+8:35: +8:36
15     let _11: E;                          // in scope 0 at $DIR/try_identity_e2e.rs:+9:32: +9:33
16     let mut _12: E;                      // in scope 0 at $DIR/try_identity_e2e.rs:+9:49: +9:50
17     scope 1 {
18         debug v => _5;                   // in scope 1 at $DIR/try_identity_e2e.rs:+4:20: +4:21
19     }
20     scope 2 {
21         debug e => _7;                   // in scope 2 at $DIR/try_identity_e2e.rs:+5:21: +5:22
22     }
23     scope 3 {
24         debug v => _10;                  // in scope 3 at $DIR/try_identity_e2e.rs:+8:35: +8:36
25     }
26     scope 4 {
27         debug e => _11;                  // in scope 4 at $DIR/try_identity_e2e.rs:+9:32: +9:33
28     }
29
30     bb0: {
31         StorageLive(_2);                 // scope 0 at $DIR/try_identity_e2e.rs:+2:9: +10:10
32         StorageLive(_3);                 // scope 0 at $DIR/try_identity_e2e.rs:+2:15: +7:10
33         _4 = discriminant(_1);           // scope 0 at $DIR/try_identity_e2e.rs:+3:19: +3:20
34         switchInt(move _4) -> [0_isize: bb2, 1_isize: bb1, otherwise: bb4]; // scope 0 at $DIR/try_identity_e2e.rs:+3:13: +3:20
35     }
36
37     bb1: {
38         StorageLive(_7);                 // scope 0 at $DIR/try_identity_e2e.rs:+5:21: +5:22
39         _7 = move ((_1 as Err).0: E);    // scope 0 at $DIR/try_identity_e2e.rs:+5:21: +5:22
40         StorageLive(_8);                 // scope 2 at $DIR/try_identity_e2e.rs:+5:46: +5:47
41         _8 = move _7;                    // scope 2 at $DIR/try_identity_e2e.rs:+5:46: +5:47
42         Deinit(_3);                      // scope 2 at $DIR/try_identity_e2e.rs:+5:27: +5:48
43         ((_3 as Break).0: E) = move _8;  // scope 2 at $DIR/try_identity_e2e.rs:+5:27: +5:48
44         discriminant(_3) = 1;            // scope 2 at $DIR/try_identity_e2e.rs:+5:27: +5:48
45         StorageDead(_8);                 // scope 2 at $DIR/try_identity_e2e.rs:+5:47: +5:48
46         StorageDead(_7);                 // scope 0 at $DIR/try_identity_e2e.rs:+5:47: +5:48
47         _9 = discriminant(_3);           // scope 0 at $DIR/try_identity_e2e.rs:+2:15: +7:10
48         switchInt(move _9) -> [0_isize: bb5, 1_isize: bb3, otherwise: bb4]; // scope 0 at $DIR/try_identity_e2e.rs:+2:9: +7:10
49     }
50
51     bb2: {
52         StorageLive(_5);                 // scope 0 at $DIR/try_identity_e2e.rs:+4:20: +4:21
53         _5 = move ((_1 as Ok).0: T);     // scope 0 at $DIR/try_identity_e2e.rs:+4:20: +4:21
54         StorageLive(_6);                 // scope 1 at $DIR/try_identity_e2e.rs:+4:48: +4:49
55         _6 = move _5;                    // scope 1 at $DIR/try_identity_e2e.rs:+4:48: +4:49
56         Deinit(_3);                      // scope 1 at $DIR/try_identity_e2e.rs:+4:26: +4:50
57         ((_3 as Continue).0: T) = move _6; // scope 1 at $DIR/try_identity_e2e.rs:+4:26: +4:50
58         discriminant(_3) = 0;            // scope 1 at $DIR/try_identity_e2e.rs:+4:26: +4:50
59         StorageDead(_6);                 // scope 1 at $DIR/try_identity_e2e.rs:+4:49: +4:50
60         StorageDead(_5);                 // scope 0 at $DIR/try_identity_e2e.rs:+4:49: +4:50
61         _9 = discriminant(_3);           // scope 0 at $DIR/try_identity_e2e.rs:+2:15: +7:10
62         switchInt(move _9) -> [0_isize: bb5, 1_isize: bb3, otherwise: bb4]; // scope 0 at $DIR/try_identity_e2e.rs:+2:9: +7:10
63     }
64
65     bb3: {
66         StorageLive(_11);                // scope 0 at $DIR/try_identity_e2e.rs:+9:32: +9:33
67         _11 = move ((_3 as Break).0: E); // scope 0 at $DIR/try_identity_e2e.rs:+9:32: +9:33
68         StorageLive(_12);                // scope 4 at $DIR/try_identity_e2e.rs:+9:49: +9:50
69         _12 = move _11;                  // scope 4 at $DIR/try_identity_e2e.rs:+9:49: +9:50
70         Deinit(_0);                      // scope 4 at $DIR/try_identity_e2e.rs:+9:45: +9:51
71         ((_0 as Err).0: E) = move _12;   // scope 4 at $DIR/try_identity_e2e.rs:+9:45: +9:51
72         discriminant(_0) = 1;            // scope 4 at $DIR/try_identity_e2e.rs:+9:45: +9:51
73         StorageDead(_12);                // scope 4 at $DIR/try_identity_e2e.rs:+9:50: +9:51
74         StorageDead(_11);                // scope 0 at $DIR/try_identity_e2e.rs:+9:50: +9:51
75         StorageDead(_2);                 // scope 0 at $DIR/try_identity_e2e.rs:+11:5: +11:6
76         StorageDead(_3);                 // scope 0 at $DIR/try_identity_e2e.rs:+12:1: +12:2
77         return;                          // scope 0 at $DIR/try_identity_e2e.rs:+12:1: +12:2
78     }
79
80     bb4: {
81         unreachable;                     // scope 0 at $DIR/try_identity_e2e.rs:+2:15: +7:10
82     }
83
84     bb5: {
85         StorageLive(_10);                // scope 0 at $DIR/try_identity_e2e.rs:+8:35: +8:36
86         _10 = move ((_3 as Continue).0: T); // scope 0 at $DIR/try_identity_e2e.rs:+8:35: +8:36
87         _2 = move _10;                   // scope 3 at $DIR/try_identity_e2e.rs:+8:41: +8:42
88         StorageDead(_10);                // scope 0 at $DIR/try_identity_e2e.rs:+8:41: +8:42
89         Deinit(_0);                      // scope 0 at $DIR/try_identity_e2e.rs:+1:5: +11:6
90         ((_0 as Ok).0: T) = move _2;     // scope 0 at $DIR/try_identity_e2e.rs:+1:5: +11:6
91         discriminant(_0) = 0;            // scope 0 at $DIR/try_identity_e2e.rs:+1:5: +11:6
92         StorageDead(_2);                 // scope 0 at $DIR/try_identity_e2e.rs:+11:5: +11:6
93         StorageDead(_3);                 // scope 0 at $DIR/try_identity_e2e.rs:+12:1: +12:2
94         return;                          // scope 0 at $DIR/try_identity_e2e.rs:+12:1: +12:2
95     }
96 }