We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1962d75 commit 77fd0a7Copy full SHA for 77fd0a7
src/test/mir-opt/no-spurious-drop-after-call.rs
@@ -0,0 +1,24 @@
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
0 commit comments