Skip to content

Commit 7a2e306

Browse files
committed
Add some more pattern variants to the unresolvable-upvar test
1 parent b28c2c7 commit 7a2e306

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
@@ -25,8 +25,16 @@ fn main() {
2525

2626
let mref = &mut arr;
2727

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

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

0 commit comments

Comments
 (0)