]> git.lizzy.rs Git - rust.git/blob - tests/ui/block_in_if_condition_closure.stderr
Auto merge of #5522 - CrazyRoka:match_vec_item, r=phansch
[rust.git] / tests / ui / block_in_if_condition_closure.stderr
1 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`
2   --> $DIR/block_in_if_condition_closure.rs:19:17
3    |
4 LL |               |x| {
5    |  _________________^
6 LL | |                 let target = 3;
7 LL | |                 x == target
8 LL | |             },
9    | |_____________^
10    |
11    = note: `-D clippy::block-in-if-condition-stmt` implied by `-D warnings`
12
13 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`
14   --> $DIR/block_in_if_condition_closure.rs:28:13
15    |
16 LL |           |x| {
17    |  _____________^
18 LL | |             let target = 3;
19 LL | |             x == target
20 LL | |         },
21    | |_________^
22
23 error: aborting due to 2 previous errors
24