Skip to content

Commit 11fb3c1

Browse files
committed
Account for let_chains in collapsible_if ui test cases.
1 parent 7eb8eaa commit 11fb3c1

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/ui/collapsible_if.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,4 +200,25 @@ fn main() {
200200
println!("Hello world!");
201201
}
202202
}
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+
}
203224
}

0 commit comments

Comments
 (0)