]> git.proxmox.com Git - rustc.git/blame - src/tools/clippy/tests/ui/block_in_if_condition.stderr
New upstream version 1.23.0+dfsg1
[rustc.git] / src / tools / clippy / tests / ui / block_in_if_condition.stderr
CommitLineData
ea8adc8c
XL
1error: 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.rs:30:8
3 |
430 | if {
5 | ________^
631 | | let x = 3;
732 | | x == 3
833 | | } {
9 | |_____^
10 |
11 = note: `-D block-in-if-condition-stmt` implied by `-D warnings`
12 = help: try
13 let res = {
14 let x = 3;
15 x == 3
16 };
17 if res {
18 6
19 } ...
20
21error: omit braces around single expression condition
22 --> $DIR/block_in_if_condition.rs:41:8
23 |
2441 | if { true } {
25 | ^^^^^^^^
26 |
27 = note: `-D block-in-if-condition-expr` implied by `-D warnings`
28 = help: try
29 if true {
30 6
31 } ...
32
33error: in an 'if' condition, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a 'let'
34 --> $DIR/block_in_if_condition.rs:58:49
35 |
3658 | if v == 3 && sky == "blue" && predicate(|x| { let target = 3; x == target }, v) {
37 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
38
39error: in an 'if' condition, avoid complex blocks or closures with blocks; instead, move the block or closure higher and bind it with a 'let'
40 --> $DIR/block_in_if_condition.rs:61:22
41 |
4261 | if predicate(|x| { let target = 3; x == target }, v) {
43 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
44
45error: this boolean expression can be simplified
46 --> $DIR/block_in_if_condition.rs:67:8
47 |
4867 | if true && x == 3 {
49 | ^^^^^^^^^^^^^^ help: try: `x == 3`
50 |
51 = note: `-D nonminimal-bool` implied by `-D warnings`
52