]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/loop_test.main.SimplifyCfg-promote-consts.after.mir
Fix diagnostic issue when using FakeReads in closures
[rust.git] / src / test / mir-opt / loop_test.main.SimplifyCfg-promote-consts.after.mir
1 // MIR for `main` after SimplifyCfg-promote-consts
2
3 fn main() -> () {
4     let mut _0: ();                      // return place in scope 0 at $DIR/loop_test.rs:6:11: 6:11
5     let _1: ();                          // in scope 0 at $DIR/loop_test.rs:10:5: 12:6
6     let mut _2: bool;                    // in scope 0 at $DIR/loop_test.rs:10:8: 10:12
7     let mut _3: !;                       // in scope 0 at $DIR/loop_test.rs:10:13: 12:6
8     let mut _4: !;                       // in scope 0 at $DIR/loop_test.rs:13:5: 16:6
9     let mut _5: ();                      // in scope 0 at $DIR/loop_test.rs:6:1: 17:2
10     let _6: i32;                         // in scope 0 at $DIR/loop_test.rs:14:13: 14:14
11     scope 1 {
12         debug x => _6;                   // in scope 1 at $DIR/loop_test.rs:14:13: 14:14
13     }
14
15     bb0: {
16         StorageLive(_1);                 // scope 0 at $DIR/loop_test.rs:10:5: 12:6
17         StorageLive(_2);                 // scope 0 at $DIR/loop_test.rs:10:8: 10:12
18         _2 = const true;                 // scope 0 at $DIR/loop_test.rs:10:8: 10:12
19         switchInt(move _2) -> [false: bb2, otherwise: bb1]; // scope 0 at $DIR/loop_test.rs:10:5: 12:6
20     }
21
22     bb1: {
23         _0 = const ();                   // scope 0 at $DIR/loop_test.rs:11:9: 11:15
24         StorageDead(_2);                 // scope 0 at $DIR/loop_test.rs:12:5: 12:6
25         StorageDead(_1);                 // scope 0 at $DIR/loop_test.rs:12:5: 12:6
26         return;                          // scope 0 at $DIR/loop_test.rs:17:2: 17:2
27     }
28
29     bb2: {
30         _1 = const ();                   // scope 0 at $DIR/loop_test.rs:12:6: 12:6
31         StorageDead(_2);                 // scope 0 at $DIR/loop_test.rs:12:5: 12:6
32         StorageDead(_1);                 // scope 0 at $DIR/loop_test.rs:12:5: 12:6
33         StorageLive(_4);                 // scope 0 at $DIR/loop_test.rs:13:5: 16:6
34         goto -> bb3;                     // scope 0 at $DIR/loop_test.rs:13:5: 16:6
35     }
36
37     bb3: {
38         falseUnwind -> [real: bb4, cleanup: bb5]; // scope 0 at $DIR/loop_test.rs:13:5: 16:6
39     }
40
41     bb4: {
42         StorageLive(_6);                 // scope 0 at $DIR/loop_test.rs:14:13: 14:14
43         _6 = const 1_i32;                // scope 0 at $DIR/loop_test.rs:14:17: 14:18
44         FakeRead(ForLet(None), _6);      // scope 0 at $DIR/loop_test.rs:14:13: 14:14
45         StorageDead(_6);                 // scope 0 at $DIR/loop_test.rs:16:5: 16:6
46         goto -> bb3;                     // scope 0 at $DIR/loop_test.rs:1:1: 1:1
47     }
48
49     bb5 (cleanup): {
50         resume;                          // scope 0 at $DIR/loop_test.rs:6:1: 17:2
51     }
52 }