]> git.lizzy.rs Git - rust.git/blob - src/tools/clippy/tests/ui/needless_continue.stderr
make const_err a hard error
[rust.git] / src / tools / clippy / tests / ui / needless_continue.stderr
1 error: this `else` block is redundant
2   --> $DIR/needless_continue.rs:30:16
3    |
4 LL |           } else {
5    |  ________________^
6 LL | |             continue;
7 LL | |         }
8    | |_________^
9    |
10    = help: consider dropping the `else` clause and merging the code that follows (in the loop) with the `if` block
11                    if i % 2 == 0 && i % 3 == 0 {
12                        println!("{}", i);
13                        println!("{}", i + 1);
14                        if i % 5 == 0 {
15                            println!("{}", i + 2);
16                        }
17                        let i = 0;
18                        println!("bar {} ", i);
19                        // merged code follows:
20                        println!("bleh");
21                        {
22                            println!("blah");
23                        }
24                        if !(!(i == 2) || !(i == 5)) {
25                            println!("lama");
26                        }
27                        if (zero!(i % 2) || nonzero!(i % 5)) && i % 3 != 0 {
28                            continue;
29                        } else {
30                            println!("Blabber");
31                            println!("Jabber");
32                        }
33                        println!("bleh");
34                    }
35    = note: `-D clippy::needless-continue` implied by `-D warnings`
36
37 error: there is no need for an explicit `else` block for this `if` expression
38   --> $DIR/needless_continue.rs:45:9
39    |
40 LL | /         if (zero!(i % 2) || nonzero!(i % 5)) && i % 3 != 0 {
41 LL | |             continue;
42 LL | |         } else {
43 LL | |             println!("Blabber");
44 LL | |             println!("Jabber");
45 LL | |         }
46    | |_________^
47    |
48    = help: consider dropping the `else` clause
49                    if (zero!(i % 2) || nonzero!(i % 5)) && i % 3 != 0 {
50                        continue;
51                    }
52                    {
53                        println!("Blabber");
54                        println!("Jabber");
55                    }
56
57 error: this `continue` expression is redundant
58   --> $DIR/needless_continue.rs:58:9
59    |
60 LL |         continue; // should lint here
61    |         ^^^^^^^^^
62    |
63    = help: consider dropping the `continue` expression
64
65 error: this `continue` expression is redundant
66   --> $DIR/needless_continue.rs:65:9
67    |
68 LL |         continue; // should lint here
69    |         ^^^^^^^^^
70    |
71    = help: consider dropping the `continue` expression
72
73 error: this `continue` expression is redundant
74   --> $DIR/needless_continue.rs:72:9
75    |
76 LL |         continue // should lint here
77    |         ^^^^^^^^
78    |
79    = help: consider dropping the `continue` expression
80
81 error: this `continue` expression is redundant
82   --> $DIR/needless_continue.rs:80:9
83    |
84 LL |         continue // should lint here
85    |         ^^^^^^^^
86    |
87    = help: consider dropping the `continue` expression
88
89 error: this `else` block is redundant
90   --> $DIR/needless_continue.rs:130:24
91    |
92 LL |                   } else {
93    |  ________________________^
94 LL | |                     continue 'inner; // should lint here
95 LL | |                 }
96    | |_________________^
97    |
98    = help: consider dropping the `else` clause and merging the code that follows (in the loop) with the `if` block
99                            if condition() {
100                                println!("bar-3");
101                                // merged code follows:
102                                println!("bar-4");
103                                update_condition();
104                                if condition() {
105                                    continue; // should lint here
106                                } else {
107                                    println!("bar-5");
108                                }
109                                println!("bar-6");
110                            }
111
112 error: there is no need for an explicit `else` block for this `if` expression
113   --> $DIR/needless_continue.rs:136:17
114    |
115 LL | /                 if condition() {
116 LL | |                     continue; // should lint here
117 LL | |                 } else {
118 LL | |                     println!("bar-5");
119 LL | |                 }
120    | |_________________^
121    |
122    = help: consider dropping the `else` clause
123                            if condition() {
124                                continue; // should lint here
125                            }
126                            {
127                                println!("bar-5");
128                            }
129
130 error: aborting due to 8 previous errors
131