Skip to content

Commit c0a7d55

Browse files
committed
Update test to cover #18769
1 parent fb4e618 commit c0a7d55

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/test/run-pass/unboxed-closures-move-mutable.rs

+11-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@
1414
// Test that mutating a mutable upvar in a capture-by-value unboxed
1515
// closure does not ice (issue #18238) and marks the upvar as used
1616
// mutably so we do not get a spurious warning about it not needing to
17-
// be declared mutable (issue #18336).
17+
// be declared mutable (issue #18336 and #18769)
18+
19+
fn set(x: &mut uint) { *x = 42; }
1820

1921
fn main() {
2022
{
@@ -25,4 +27,12 @@ fn main() {
2527
let mut x = 0u;
2628
move |:| x += 1;
2729
}
30+
{
31+
let mut x = 0u;
32+
move |&mut:| set(&mut x);
33+
}
34+
{
35+
let mut x = 0u;
36+
move |:| set(&mut x);
37+
}
2838
}

0 commit comments

Comments
 (0)