diff --git a/tests/ui/block_in_if_condition.rs b/tests/ui/block_in_if_condition.rs index feb28e37797..64832771715 100644 --- a/tests/ui/block_in_if_condition.rs +++ b/tests/ui/block_in_if_condition.rs @@ -56,13 +56,10 @@ fn pred_test() { // inside a closure that the condition is using. same principle applies. add some extra // expressions to make sure linter isn't confused by them. if v == 3 && sky == "blue" && predicate(|x| { let target = 3; x == target }, v) { - } if predicate(|x| { let target = 3; x == target }, v) { - } - } fn condition_is_normal() -> i32 { diff --git a/tests/ui/block_in_if_condition.stderr b/tests/ui/block_in_if_condition.stderr index 403ad7efe8d..fb7f1179863 100644 --- a/tests/ui/block_in_if_condition.stderr +++ b/tests/ui/block_in_if_condition.stderr @@ -45,15 +45,15 @@ error: in an 'if' condition, avoid complex blocks or closures with blocks; inste | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: in an 'if' condition, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a 'let' - --> $DIR/block_in_if_condition.rs:62:22 + --> $DIR/block_in_if_condition.rs:61:22 | -62 | if predicate(|x| { let target = 3; x == target }, v) { +61 | if predicate(|x| { let target = 3; x == target }, v) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ warning: this boolean expression can be simplified - --> $DIR/block_in_if_condition.rs:70:8 + --> $DIR/block_in_if_condition.rs:67:8 | -70 | if true && x == 3 { +67 | if true && x == 3 { | ^^^^^^^^^^^^^^ help: try `x == 3` | note: lint level defined here