]> git.lizzy.rs Git - rust.git/blob - tests/mir-opt/no_spurious_drop_after_call.main.ElaborateDrops.before.mir
Rollup merge of #107706 - tgross35:atomic-as-mut-ptr, r=m-ou-se
[rust.git] / tests / mir-opt / no_spurious_drop_after_call.main.ElaborateDrops.before.mir
1 // MIR for `main` before ElaborateDrops
2
3 fn main() -> () {
4     let mut _0: ();                      // return place in scope 0 at $DIR/no_spurious_drop_after_call.rs:+0:11: +0:11
5     let _1: ();                          // in scope 0 at $DIR/no_spurious_drop_after_call.rs:+1:5: +1:35
6     let mut _2: std::string::String;     // in scope 0 at $DIR/no_spurious_drop_after_call.rs:+1:20: +1:34
7     let mut _3: &str;                    // in scope 0 at $DIR/no_spurious_drop_after_call.rs:+1:20: +1:34
8     let _4: &str;                        // in scope 0 at $DIR/no_spurious_drop_after_call.rs:+1:20: +1:22
9
10     bb0: {
11         StorageLive(_1);                 // scope 0 at $DIR/no_spurious_drop_after_call.rs:+1:5: +1:35
12         StorageLive(_2);                 // scope 0 at $DIR/no_spurious_drop_after_call.rs:+1:20: +1:34
13         StorageLive(_3);                 // scope 0 at $DIR/no_spurious_drop_after_call.rs:+1:20: +1:34
14         StorageLive(_4);                 // scope 0 at $DIR/no_spurious_drop_after_call.rs:+1:20: +1:22
15         _4 = const "";                   // scope 0 at $DIR/no_spurious_drop_after_call.rs:+1:20: +1:22
16                                          // mir::Constant
17                                          // + span: $DIR/no_spurious_drop_after_call.rs:9:20: 9:22
18                                          // + literal: Const { ty: &str, val: Value(Slice(..)) }
19         _3 = &(*_4);                     // scope 0 at $DIR/no_spurious_drop_after_call.rs:+1:20: +1:34
20         _2 = <str as ToString>::to_string(move _3) -> bb1; // scope 0 at $DIR/no_spurious_drop_after_call.rs:+1:20: +1:34
21                                          // mir::Constant
22                                          // + span: $DIR/no_spurious_drop_after_call.rs:9:23: 9:32
23                                          // + literal: Const { ty: for<'a> fn(&'a str) -> String {<str as ToString>::to_string}, val: Value(<ZST>) }
24     }
25
26     bb1: {
27         StorageDead(_3);                 // scope 0 at $DIR/no_spurious_drop_after_call.rs:+1:33: +1:34
28         _1 = std::mem::drop::<String>(move _2) -> [return: bb2, unwind: bb3]; // scope 0 at $DIR/no_spurious_drop_after_call.rs:+1:5: +1:35
29                                          // mir::Constant
30                                          // + span: $DIR/no_spurious_drop_after_call.rs:9:5: 9:19
31                                          // + literal: Const { ty: fn(String) {std::mem::drop::<String>}, val: Value(<ZST>) }
32     }
33
34     bb2: {
35         StorageDead(_2);                 // scope 0 at $DIR/no_spurious_drop_after_call.rs:+1:34: +1:35
36         StorageDead(_4);                 // scope 0 at $DIR/no_spurious_drop_after_call.rs:+1:35: +1:36
37         StorageDead(_1);                 // scope 0 at $DIR/no_spurious_drop_after_call.rs:+1:35: +1:36
38         _0 = const ();                   // scope 0 at $DIR/no_spurious_drop_after_call.rs:+0:11: +2:2
39         return;                          // scope 0 at $DIR/no_spurious_drop_after_call.rs:+2:2: +2:2
40     }
41
42     bb3 (cleanup): {
43         drop(_2) -> bb4;                 // scope 0 at $DIR/no_spurious_drop_after_call.rs:+1:34: +1:35
44     }
45
46     bb4 (cleanup): {
47         resume;                          // scope 0 at $DIR/no_spurious_drop_after_call.rs:+0:1: +2:2
48     }
49 }