rust/src/test/mir-opt/simplify_try.rs
Wesley Wiser f9d7720be7 Disable the SimplifyArmIdentity mir-opt
The optimization still has some bugs that need to be worked out
such as #77359.

We can try re-enabling this again after the known issues are resolved.
2020-10-01 20:29:53 -04:00

14 lines
432 B
Rust

// compile-flags: -Zunsound-mir-opts
// EMIT_MIR simplify_try.try_identity.SimplifyArmIdentity.diff
// EMIT_MIR simplify_try.try_identity.SimplifyBranchSame.after.mir
// EMIT_MIR simplify_try.try_identity.SimplifyLocals.after.mir
// EMIT_MIR simplify_try.try_identity.DestinationPropagation.diff
fn try_identity(x: Result<u32, i32>) -> Result<u32, i32> {
let y = x?;
Ok(y)
}
fn main() {
let _ = try_identity(Ok(0));
}