]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/no-spurious-drop-after-call.rs
Render const pointers in MIR more compactly
[rust.git] / src / test / mir-opt / no-spurious-drop-after-call.rs
1 // ignore-wasm32-bare compiled with panic=abort by default
2
3 // Test that after the call to `std::mem::drop` we do not generate a
4 // MIR drop of the argument. (We used to have a `DROP(_2)` in the code
5 // below, as part of bb3.)
6
7 fn main() {
8     std::mem::drop("".to_string());
9 }
10
11 // END RUST SOURCE
12 // START rustc.main.ElaborateDrops.before.mir
13 //    bb2: {
14 //        StorageDead(_3);
15 //        _1 = const std::mem::drop::<std::string::String>(move _2) -> [return: bb3, unwind: bb4];
16 //    }
17 //    bb3: {
18 //        StorageDead(_2);
19 //        StorageDead(_4);
20 //        StorageDead(_1);
21 //        _0 = ();
22 //        return;
23 //    }
24 // END rustc.main.ElaborateDrops.before.mir