Skip to content

Commit 19c9ccd

Browse files
committed
Add some more pattern variants to the unresolvable-upvar test
1 parent 6264030 commit 19c9ccd

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tests/ui/closures/2229_closure_analysis/unresolvable-upvar-issue-87987.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,16 @@ fn main() {
2626

2727
let mref = &mut arr;
2828

29+
// These array patterns don't need to inspect the array, so the array
30+
// isn't captured.
2931
let _c = || match arr {
30-
[_, _, _, _] => println!("A"),
32+
[_, _, _, _] => println!("C"),
33+
};
34+
let _d = || match arr {
35+
[_, .., _] => println!("D"),
36+
};
37+
let _e = || match arr {
38+
[_, ..] => println!("E"),
3139
};
3240

3341
println!("{:#?}", mref);

0 commit comments

Comments
 (0)