]> git.lizzy.rs Git - rust.git/blob - tests/mir-opt/issue_41888.rs
Remove from librustdoc and clippy too
[rust.git] / tests / mir-opt / issue_41888.rs
1 // ignore-wasm32-bare compiled with panic=abort by default
2 // check that we clear the "ADT master drop flag" even when there are
3 // no fields to be dropped.
4
5 // EMIT_MIR issue_41888.main.ElaborateDrops.after.mir
6 fn 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
17 fn cond() -> bool { false }
18
19 struct K;
20
21 enum E {
22     F(K),
23     G(Box<E>)
24 }