rust/src/test/mir-opt/simplify-locals-removes-unused-discriminant-reads.rs
Wesley Wiser 75e2e8c71b Remove unused discriminant reads from MIR bodies
Allow the `SimplifyLocals` pass to remove reads of discriminants if the
read is never used.
2020-04-02 08:14:34 -04:00

13 lines
193 B
Rust

fn map(x: Option<Box<()>>) -> Option<Box<()>> {
match x {
None => None,
Some(x) => Some(x),
}
}
fn main() {
map(None);
}
// EMIT_MIR rustc.map.SimplifyLocals.diff