-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add a mir-opt test that we don't add the spurious drop
- Loading branch information
1 parent
1962d75
commit 77fd0a7
Showing
1 changed file
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
// ignore-wasm32-bare compiled with panic=abort by default | ||
|
||
// Test that after the call to `std::mem::drop` we do not generate a | ||
// MIR drop of the argument. (We used to have a `DROP(_2)` in the code | ||
// below, as part of bb3.) | ||
|
||
fn main() { | ||
std::mem::drop("".to_string()); | ||
} | ||
|
||
// END RUST SOURCE | ||
// START rustc.main.ElaborateDrops.before.mir | ||
// bb2: { | ||
// StorageDead(_3); | ||
// _1 = const std::mem::drop::<std::string::String>(move _2) -> [return: bb3, unwind: bb4]; | ||
// } | ||
// bb3: { | ||
// StorageDead(_2); | ||
// StorageDead(_4); | ||
// StorageDead(_1); | ||
// _0 = (); | ||
// return; | ||
// } | ||
// END rustc.main.ElaborateDrops.before.mir |