]> git.lizzy.rs Git - rust.git/blob - tests/ui/needless_continue.stderr
Update ui tests to new rustc range printing
[rust.git] / tests / ui / needless_continue.stderr
1 error: This else block is redundant.
2
3   --> $DIR/needless_continue.rs:26:16
4    |
5 26 |           } else {
6    |  ________________^
7 27 | |             continue;
8 28 | |         }
9    | |_________^
10    |
11 note: lint level defined here
12   --> $DIR/needless_continue.rs:12:8
13    |
14 12 | #[deny(needless_continue)]
15    |        ^^^^^^^^^^^^^^^^^
16    = help: Consider dropping the else clause and merging the code that follows (in the loop) with the if block, like so:
17            if i % 2 == 0 && i % 3 == 0 {
18            println!("{}", i);
19            println!("{}", i+1);
20            if i % 5 == 0 {
21                println!("{}", i+2);
22            }
23            let i = 0;
24            println!("bar {} ", i);
25            // Merged code follows...println!("bleh");
26            {
27                println!("blah");
28            }
29            if !(!(i == 2) || !(i == 5)) {
30                println!("lama");
31            }
32            if (zero!(i % 2) || nonzero!(i % 5)) && i % 3 != 0 {
33                continue;
34            } else {
35                println!("Blabber");
36                println!("Jabber");
37            }
38            println!("bleh");
39            }
40            
41
42 error: There is no need for an explicit `else` block for this `if` expression
43
44   --> $DIR/needless_continue.rs:41:9
45    |
46 41 | /         if (zero!(i % 2) || nonzero!(i % 5)) && i % 3 != 0 {
47 42 | |             continue;
48 43 | |         } else {
49 44 | |             println!("Blabber");
50 45 | |             println!("Jabber");
51 46 | |         }
52    | |_________^
53    |
54    = help: Consider dropping the else clause, and moving out the code in the else block, like so:
55            if (zero!(i % 2) || nonzero!(i % 5)) && i % 3 != 0 {
56                continue;
57            }
58            println!("Blabber");
59            println!("Jabber");
60            ...
61
62 error: aborting due to 2 previous errors
63