]> git.lizzy.rs Git - rust.git/blob - tests/ui/needless_continue.stderr
Auto merge of #8374 - Alexendoo:bless-revisions, r=camsteffen
[rust.git] / tests / ui / needless_continue.stderr
1 error: this `else` block is redundant
2   --> $DIR/needless_continue.rs:29:16
3    |
4 LL |           } else {
5    |  ________________^
6 LL | |             continue;
7 LL | |         }
8    | |_________^
9    |
10    = note: `-D clippy::needless-continue` implied by `-D warnings`
11    = help: consider dropping the `else` clause and merging the code that follows (in the loop) with the `if` block
12                    if i % 2 == 0 && i % 3 == 0 {
13                        println!("{}", i);
14                        println!("{}", i + 1);
15                        if i % 5 == 0 {
16                            println!("{}", i + 2);
17                        }
18                        let i = 0;
19                        println!("bar {} ", i);
20                        // merged code follows:
21                        println!("bleh");
22                        {
23                            println!("blah");
24                        }
25                        if !(!(i == 2) || !(i == 5)) {
26                            println!("lama");
27                        }
28                        if (zero!(i % 2) || nonzero!(i % 5)) && i % 3 != 0 {
29                            continue;
30                        } else {
31                            println!("Blabber");
32                            println!("Jabber");
33                        }
34                        println!("bleh");
35                    }
36
37 error: there is no need for an explicit `else` block for this `if` expression
38   --> $DIR/needless_continue.rs:44: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:57: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:64: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:71: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:79: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:129: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:135: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