fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
4.3 KiB140 linesraw
1error: this `else` block is redundant
2  --> $DIR/needless_continue.rs:30:16
3   |
4LL |           } else {
5   |  ________________^
6LL | |
7LL | |             continue;
8LL | |         }
9   | |_________^
10   |
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
30                           continue;
31                       } else {
32                           println!("Blabber");
33                           println!("Jabber");
34                       }
35                       println!("bleh");
36                   }
37   = note: `-D clippy::needless-continue` implied by `-D warnings`
38   = help: to override `-D warnings` add `#[allow(clippy::needless_continue)]`
39
40error: there is no need for an explicit `else` block for this `if` expression
41  --> $DIR/needless_continue.rs:46:9
42   |
43LL | /         if (zero!(i % 2) || nonzero!(i % 5)) && i % 3 != 0 {
44LL | |
45LL | |             continue;
46LL | |         } else {
47LL | |             println!("Blabber");
48LL | |             println!("Jabber");
49LL | |         }
50   | |_________^
51   |
52   = help: consider dropping the `else` clause
53                   if (zero!(i % 2) || nonzero!(i % 5)) && i % 3 != 0 {
54
55                       continue;
56                   }
57                   {
58                       println!("Blabber");
59                       println!("Jabber");
60                   }
61
62error: this `continue` expression is redundant
63  --> $DIR/needless_continue.rs:60:9
64   |
65LL |         continue;
66   |         ^^^^^^^^^
67   |
68   = help: consider dropping the `continue` expression
69
70error: this `continue` expression is redundant
71  --> $DIR/needless_continue.rs:68:9
72   |
73LL |         continue;
74   |         ^^^^^^^^^
75   |
76   = help: consider dropping the `continue` expression
77
78error: this `continue` expression is redundant
79  --> $DIR/needless_continue.rs:76:9
80   |
81LL |         continue
82   |         ^^^^^^^^
83   |
84   = help: consider dropping the `continue` expression
85
86error: this `continue` expression is redundant
87  --> $DIR/needless_continue.rs:85:9
88   |
89LL |         continue
90   |         ^^^^^^^^
91   |
92   = help: consider dropping the `continue` expression
93
94error: this `else` block is redundant
95  --> $DIR/needless_continue.rs:136:24
96   |
97LL |                   } else {
98   |  ________________________^
99LL | |
100LL | |                     continue 'inner;
101LL | |                 }
102   | |_________________^
103   |
104   = help: consider dropping the `else` clause and merging the code that follows (in the loop) with the `if` block
105                           if condition() {
106                               println!("bar-3");
107                               // merged code follows:
108                               println!("bar-4");
109                               update_condition();
110                               if condition() {
111
112                                   continue;
113                               } else {
114                                   println!("bar-5");
115                               }
116                               println!("bar-6");
117                           }
118
119error: there is no need for an explicit `else` block for this `if` expression
120  --> $DIR/needless_continue.rs:143:17
121   |
122LL | /                 if condition() {
123LL | |
124LL | |                     continue;
125LL | |                 } else {
126LL | |                     println!("bar-5");
127LL | |                 }
128   | |_________________^
129   |
130   = help: consider dropping the `else` clause
131                           if condition() {
132
133                               continue;
134                           }
135                           {
136                               println!("bar-5");
137                           }
138
139error: aborting due to 8 previous errors
140