`if true` is recognized by MIR optimization.
This commit is contained in:
Shotaro Yamada 2018-12-09 19:18:44 +09:00
parent 790e611c9c
commit a4fe567602
1 changed files with 2 additions and 2 deletions

View File

@ -38,8 +38,8 @@ fn main() {
#[derive(Clone)]
struct Alpha;
fn double(a: Alpha) -> (Alpha, Alpha) {
if true {
fn with_branch(a: Alpha, b: bool) -> (Alpha, Alpha) {
if b {
(a.clone(), a.clone())
} else {
(Alpha, a)