]>
Commit | Line | Data |
---|---|---|
ff7c6d11 XL |
1 | // ignore-wasm32-bare compiled with panic=abort by default |
2 | ||
cc61c64b XL |
3 | // check that we don't emit multiple drop flags when they are not needed. |
4 | ||
ba9703b0 | 5 | |
3dfed10e | 6 | // EMIT_MIR issue_41110.main.ElaborateDrops.after.mir |
cc61c64b XL |
7 | fn main() { |
8 | let x = S.other(S.id()); | |
9 | } | |
10 | ||
abe05a73 XL |
11 | // no_mangle to make sure this gets instantiated even in an executable. |
12 | #[no_mangle] | |
3dfed10e | 13 | // EMIT_MIR issue_41110.test.ElaborateDrops.after.mir |
cc61c64b XL |
14 | pub fn test() { |
15 | let u = S; | |
16 | let mut v = S; | |
17 | drop(v); | |
18 | v = u; | |
19 | } | |
20 | ||
21 | struct S; | |
22 | impl Drop for S { | |
23 | fn drop(&mut self) { | |
24 | } | |
25 | } | |
26 | ||
27 | impl S { | |
28 | fn id(self) -> Self { self } | |
29 | fn other(self, s: Self) {} | |
30 | } |