]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/generator_drop_cleanup.main-{closure#0}.generator_drop.0.mir
Auto merge of #88469 - patrick-gu:master, r=dtolnay
[rust.git] / src / test / mir-opt / generator_drop_cleanup.main-{closure#0}.generator_drop.0.mir
1 // MIR for `main::{closure#0}` 0 generator_drop
2 /* generator_layout = GeneratorLayout {
3     field_tys: {
4         _0: std::string::String,
5     },
6     variant_fields: {
7         Unresumed(0): [],
8         Returned (1): [],
9         Panicked (2): [],
10         Suspend0 (3): [_0],
11     },
12     storage_conflicts: BitMatrix(1x1) {
13         (_0, _0),
14     },
15 } */
16
17 fn main::{closure#0}(_1: *mut [generator@$DIR/generator-drop-cleanup.rs:10:15: 13:6]) -> () {
18     let mut _0: ();                      // return place in scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
19     let mut _2: ();                      // in scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
20     let _3: std::string::String;         // in scope 0 at $DIR/generator-drop-cleanup.rs:11:13: 11:15
21     let _4: ();                          // in scope 0 at $DIR/generator-drop-cleanup.rs:12:9: 12:14
22     let mut _5: ();                      // in scope 0 at $DIR/generator-drop-cleanup.rs:12:9: 12:14
23     let mut _7: ();                      // in scope 0 at $DIR/generator-drop-cleanup.rs:10:18: 10:18
24     let mut _8: ();                      // in scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
25     let mut _9: u32;                     // in scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
26     scope 1 {
27         debug _s => (((*_1) as variant#3).0: std::string::String); // in scope 1 at $DIR/generator-drop-cleanup.rs:11:13: 11:15
28     }
29     scope 2 (inlined String::new) {      // at $DIR/generator-drop-cleanup.rs:11:18: 11:31
30         let mut _6: std::vec::Vec<u8>;   // in scope 2 at $DIR/generator-drop-cleanup.rs:11:18: 11:31
31         scope 3 (inlined Vec::<u8>::new) { // at $DIR/generator-drop-cleanup.rs:11:18: 11:31
32         }
33     }
34
35     bb0: {
36         _9 = discriminant((*_1));        // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
37         switchInt(move _9) -> [0_u32: bb7, 3_u32: bb10, otherwise: bb11]; // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
38     }
39
40     bb1: {
41         StorageDead(_5);                 // scope 1 at $DIR/generator-drop-cleanup.rs:12:13: 12:14
42         StorageDead(_4);                 // scope 1 at $DIR/generator-drop-cleanup.rs:12:14: 12:15
43         drop((((*_1) as variant#3).0: std::string::String)) -> [return: bb2, unwind: bb5]; // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
44     }
45
46     bb2: {
47         nop;                             // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
48         goto -> bb8;                     // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
49     }
50
51     bb3: {
52         return;                          // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
53     }
54
55     bb4 (cleanup): {
56         resume;                          // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
57     }
58
59     bb5 (cleanup): {
60         nop;                             // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
61         goto -> bb4;                     // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
62     }
63
64     bb6: {
65         return;                          // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
66     }
67
68     bb7: {
69         goto -> bb9;                     // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
70     }
71
72     bb8: {
73         goto -> bb3;                     // scope 0 at $DIR/generator-drop-cleanup.rs:13:5: 13:6
74     }
75
76     bb9: {
77         goto -> bb6;                     // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
78     }
79
80     bb10: {
81         StorageLive(_4);                 // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
82         StorageLive(_5);                 // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
83         goto -> bb1;                     // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
84     }
85
86     bb11: {
87         return;                          // scope 0 at $DIR/generator-drop-cleanup.rs:10:15: 13:6
88     }
89 }