]> git.proxmox.com Git - rustc.git/blame - src/test/mir-opt/issue-41888.rs
New upstream version 1.66.0+dfsg1
[rustc.git] / src / test / mir-opt / issue-41888.rs
CommitLineData
ba9703b0 1// ignore-wasm32-bare compiled with panic=abort by default
7cac9316
XL
2// check that we clear the "ADT master drop flag" even when there are
3// no fields to be dropped.
4
3dfed10e 5// EMIT_MIR issue_41888.main.ElaborateDrops.after.mir
7cac9316
XL
6fn main() {
7 let e;
8 if cond() {
9 e = E::F(K);
10 if let E::F(_k) = e {
11 // older versions of rustc used to not clear the
12 // drop flag for `e` in this path.
13 }
14 }
15}
16
17fn cond() -> bool { false }
18
19struct K;
20
21enum E {
22 F(K),
23 G(Box<E>)
24}