rust/src/test/mir-opt/issue-41888.rs

24 lines
439 B
Rust
Raw Normal View History

// check that we clear the "ADT master drop flag" even when there are
// no fields to be dropped.
2020-04-02 21:09:01 +00:00
// EMIT_MIR rustc.main.ElaborateDrops.after.mir
fn main() {
let e;
if cond() {
e = E::F(K);
if let E::F(_k) = e {
// older versions of rustc used to not clear the
// drop flag for `e` in this path.
}
}
}
fn cond() -> bool { false }
struct K;
enum E {
F(K),
G(Box<E>)
}