File tree Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change @@ -172,4 +172,25 @@ else {
172
172
println!("Hello world!");
173
173
}
174
174
}
175
+
176
+ // Test behavior wrt. `let_chains`.
177
+ // None of the cases below should be collapsed.
178
+ fn truth() -> bool { true }
179
+
180
+ // Prefix:
181
+ if let 0 = 1 {
182
+ if truth() {}
183
+ }
184
+
185
+ // Suffix:
186
+ if truth() {
187
+ if let 0 = 1 {}
188
+ }
189
+
190
+ // Midfix:
191
+ if truth() {
192
+ if let 0 = 1 {
193
+ if truth() {}
194
+ }
195
+ }
175
196
}
Original file line number Diff line number Diff line change @@ -200,4 +200,25 @@ fn main() {
200
200
println ! ( "Hello world!" ) ;
201
201
}
202
202
}
203
+
204
+ // Test behavior wrt. `let_chains`.
205
+ // None of the cases below should be collapsed.
206
+ fn truth ( ) -> bool { true }
207
+
208
+ // Prefix:
209
+ if let 0 = 1 {
210
+ if truth ( ) { }
211
+ }
212
+
213
+ // Suffix:
214
+ if truth ( ) {
215
+ if let 0 = 1 { }
216
+ }
217
+
218
+ // Midfix:
219
+ if truth ( ) {
220
+ if let 0 = 1 {
221
+ if truth ( ) { }
222
+ }
223
+ }
203
224
}
You can’t perform that action at this time.
0 commit comments