]> git.lizzy.rs Git - rust.git/blob - clippy_tests/examples/collapsible_if.stderr
Fix the test suite after cargo update
[rust.git] / clippy_tests / examples / collapsible_if.stderr
1 error: this if statement can be collapsed
2   --> collapsible_if.rs:8:5
3    |
4 8  | /     if x == "hello" {
5 9  | |         if y == "world" {
6 10 | |             println!("Hello world!");
7 11 | |         }
8 12 | |     }
9    | |_____^
10    |
11    = note: `-D collapsible-if` implied by `-D warnings`
12 help: try
13    |     if x == "hello" && y == "world" {
14    |     println!("Hello world!");
15    | }
16
17 error: this if statement can be collapsed
18   --> collapsible_if.rs:14:5
19    |
20 14 | /     if x == "hello" || x == "world" {
21 15 | |         if y == "world" || y == "hello" {
22 16 | |             println!("Hello world!");
23 17 | |         }
24 18 | |     }
25    | |_____^
26    |
27    = note: `-D collapsible-if` implied by `-D warnings`
28 help: try
29    |     if (x == "hello" || x == "world") && (y == "world" || y == "hello") {
30    |     println!("Hello world!");
31    | }
32
33 error: this if statement can be collapsed
34   --> collapsible_if.rs:20:5
35    |
36 20 | /     if x == "hello" && x == "world" {
37 21 | |         if y == "world" || y == "hello" {
38 22 | |             println!("Hello world!");
39 23 | |         }
40 24 | |     }
41    | |_____^
42    |
43    = note: `-D collapsible-if` implied by `-D warnings`
44 help: try
45    |     if x == "hello" && x == "world" && (y == "world" || y == "hello") {
46    |     println!("Hello world!");
47    | }
48
49 error: this if statement can be collapsed
50   --> collapsible_if.rs:26:5
51    |
52 26 | /     if x == "hello" || x == "world" {
53 27 | |         if y == "world" && y == "hello" {
54 28 | |             println!("Hello world!");
55 29 | |         }
56 30 | |     }
57    | |_____^
58    |
59    = note: `-D collapsible-if` implied by `-D warnings`
60 help: try
61    |     if (x == "hello" || x == "world") && y == "world" && y == "hello" {
62    |     println!("Hello world!");
63    | }
64
65 error: this if statement can be collapsed
66   --> collapsible_if.rs:32:5
67    |
68 32 | /     if x == "hello" && x == "world" {
69 33 | |         if y == "world" && y == "hello" {
70 34 | |             println!("Hello world!");
71 35 | |         }
72 36 | |     }
73    | |_____^
74    |
75    = note: `-D collapsible-if` implied by `-D warnings`
76 help: try
77    |     if x == "hello" && x == "world" && y == "world" && y == "hello" {
78    |     println!("Hello world!");
79    | }
80
81 error: this if statement can be collapsed
82   --> collapsible_if.rs:38:5
83    |
84 38 | /     if 42 == 1337 {
85 39 | |         if 'a' != 'A' {
86 40 | |             println!("world!")
87 41 | |         }
88 42 | |     }
89    | |_____^
90    |
91    = note: `-D collapsible-if` implied by `-D warnings`
92 help: try
93    |     if 42 == 1337 && 'a' != 'A' {
94    |     println!("world!")
95    | }
96
97 error: this `else { if .. }` block can be collapsed
98   --> collapsible_if.rs:47:12
99    |
100 47 |       } else {
101    |  ____________^
102 48 | |         if y == "world" {
103 49 | |             println!("world!")
104 50 | |         }
105 51 | |     }
106    | |_____^
107    |
108    = note: `-D collapsible-if` implied by `-D warnings`
109 help: try
110    |     } else if y == "world" {
111    |     println!("world!")
112    | }
113
114 error: this `else { if .. }` block can be collapsed
115   --> collapsible_if.rs:55:12
116    |
117 55 |       } else {
118    |  ____________^
119 56 | |         if let Some(42) = Some(42) {
120 57 | |             println!("world!")
121 58 | |         }
122 59 | |     }
123    | |_____^
124    |
125    = note: `-D collapsible-if` implied by `-D warnings`
126 help: try
127    |     } else if let Some(42) = Some(42) {
128    |     println!("world!")
129    | }
130
131 error: this `else { if .. }` block can be collapsed
132   --> collapsible_if.rs:63:12
133    |
134 63 |       } else {
135    |  ____________^
136 64 | |         if y == "world" {
137 65 | |             println!("world")
138 66 | |         }
139 ...  |
140 69 | |         }
141 70 | |     }
142    | |_____^
143    |
144    = note: `-D collapsible-if` implied by `-D warnings`
145 help: try
146    |     } else if y == "world" {
147    |     println!("world")
148    | }
149    | else {
150    |     println!("!")
151    | }
152
153 error: this `else { if .. }` block can be collapsed
154   --> collapsible_if.rs:74:12
155    |
156 74 |       } else {
157    |  ____________^
158 75 | |         if let Some(42) = Some(42) {
159 76 | |             println!("world")
160 77 | |         }
161 ...  |
162 80 | |         }
163 81 | |     }
164    | |_____^
165    |
166    = note: `-D collapsible-if` implied by `-D warnings`
167 help: try
168    |     } else if let Some(42) = Some(42) {
169    |     println!("world")
170    | }
171    | else {
172    |     println!("!")
173    | }
174
175 error: this `else { if .. }` block can be collapsed
176   --> collapsible_if.rs:85:12
177    |
178 85 |       } else {
179    |  ____________^
180 86 | |         if let Some(42) = Some(42) {
181 87 | |             println!("world")
182 88 | |         }
183 ...  |
184 91 | |         }
185 92 | |     }
186    | |_____^
187    |
188    = note: `-D collapsible-if` implied by `-D warnings`
189 help: try
190    |     } else if let Some(42) = Some(42) {
191    |     println!("world")
192    | }
193    | else {
194    |     println!("!")
195    | }
196
197 error: this `else { if .. }` block can be collapsed
198    --> collapsible_if.rs:96:12
199     |
200 96  |       } else {
201     |  ____________^
202 97  | |         if x == "hello" {
203 98  | |             println!("world")
204 99  | |         }
205 ...   |
206 102 | |         }
207 103 | |     }
208     | |_____^
209     |
210     = note: `-D collapsible-if` implied by `-D warnings`
211 help: try
212     |     } else if x == "hello" {
213     |     println!("world")
214     | }
215     | else {
216     |     println!("!")
217     | }
218
219 error: this `else { if .. }` block can be collapsed
220    --> collapsible_if.rs:107:12
221     |
222 107 |       } else {
223     |  ____________^
224 108 | |         if let Some(42) = Some(42) {
225 109 | |             println!("world")
226 110 | |         }
227 ...   |
228 113 | |         }
229 114 | |     }
230     | |_____^
231     |
232     = note: `-D collapsible-if` implied by `-D warnings`
233 help: try
234     |     } else if let Some(42) = Some(42) {
235     |     println!("world")
236     | }
237     | else {
238     |     println!("!")
239     | }
240
241 error: aborting due to previous error(s)
242
243
244 To learn more, run the command again with --verbose.