From a4fe5676022d66ad157b4b4238d035d6035dc31e Mon Sep 17 00:00:00 2001 From: Shotaro Yamada Date: Sun, 9 Dec 2018 19:18:44 +0900 Subject: [PATCH] Fix test `if true` is recognized by MIR optimization. --- tests/ui/redundant_clone.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/ui/redundant_clone.rs b/tests/ui/redundant_clone.rs index deedde38231..e5c5528e4fa 100644 --- a/tests/ui/redundant_clone.rs +++ b/tests/ui/redundant_clone.rs @@ -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)