]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/no_drop_for_inactive_variant.unwrap.SimplifyCfg-elaborate-drops.after.mir
Rollup merge of #99864 - klensy:bootstrap-art-dupe, r=jyn514
[rust.git] / src / test / mir-opt / no_drop_for_inactive_variant.unwrap.SimplifyCfg-elaborate-drops.after.mir
1 // MIR for `unwrap` after SimplifyCfg-elaborate-drops
2
3 fn unwrap(_1: Option<T>) -> T {
4     debug opt => _1;                     // in scope 0 at $DIR/no-drop-for-inactive-variant.rs:+0:14: +0:17
5     let mut _0: T;                       // return place in scope 0 at $DIR/no-drop-for-inactive-variant.rs:+0:33: +0:34
6     let mut _2: isize;                   // in scope 0 at $DIR/no-drop-for-inactive-variant.rs:+2:9: +2:16
7     let _3: T;                           // in scope 0 at $DIR/no-drop-for-inactive-variant.rs:+2:14: +2:15
8     let mut _4: !;                       // in scope 0 at $SRC_DIR/std/src/panic.rs:LL:COL
9     let mut _5: isize;                   // in scope 0 at $DIR/no-drop-for-inactive-variant.rs:+5:1: +5:2
10     let mut _6: isize;                   // in scope 0 at $DIR/no-drop-for-inactive-variant.rs:+5:1: +5:2
11     let mut _7: isize;                   // in scope 0 at $DIR/no-drop-for-inactive-variant.rs:+5:1: +5:2
12     scope 1 {
13         debug x => _3;                   // in scope 1 at $DIR/no-drop-for-inactive-variant.rs:+2:14: +2:15
14     }
15
16     bb0: {
17         _2 = discriminant(_1);           // scope 0 at $DIR/no-drop-for-inactive-variant.rs:+1:11: +1:14
18         switchInt(move _2) -> [0_isize: bb1, 1_isize: bb3, otherwise: bb2]; // scope 0 at $DIR/no-drop-for-inactive-variant.rs:+1:5: +1:14
19     }
20
21     bb1: {
22         StorageLive(_4);                 // scope 0 at $SRC_DIR/std/src/panic.rs:LL:COL
23         _4 = begin_panic::<&str>(const "explicit panic") -> bb4; // scope 0 at $SRC_DIR/std/src/panic.rs:LL:COL
24                                          // mir::Constant
25                                          // + span: $SRC_DIR/std/src/panic.rs:LL:COL
26                                          // + literal: Const { ty: fn(&str) -> ! {begin_panic::<&str>}, val: Value(<ZST>) }
27                                          // mir::Constant
28                                          // + span: $SRC_DIR/std/src/panic.rs:LL:COL
29                                          // + literal: Const { ty: &str, val: Value(Slice(..)) }
30     }
31
32     bb2: {
33         unreachable;                     // scope 0 at $DIR/no-drop-for-inactive-variant.rs:+1:11: +1:14
34     }
35
36     bb3: {
37         StorageLive(_3);                 // scope 0 at $DIR/no-drop-for-inactive-variant.rs:+2:14: +2:15
38         _3 = move ((_1 as Some).0: T);   // scope 0 at $DIR/no-drop-for-inactive-variant.rs:+2:14: +2:15
39         _0 = move _3;                    // scope 1 at $DIR/no-drop-for-inactive-variant.rs:+2:20: +2:21
40         StorageDead(_3);                 // scope 0 at $DIR/no-drop-for-inactive-variant.rs:+2:20: +2:21
41         _5 = discriminant(_1);           // scope 0 at $DIR/no-drop-for-inactive-variant.rs:+5:1: +5:2
42         return;                          // scope 0 at $DIR/no-drop-for-inactive-variant.rs:+5:2: +5:2
43     }
44
45     bb4 (cleanup): {
46         _7 = discriminant(_1);           // scope 0 at $DIR/no-drop-for-inactive-variant.rs:+5:1: +5:2
47         resume;                          // scope 0 at $DIR/no-drop-for-inactive-variant.rs:+0:1: +5:2
48     }
49 }