We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fb4e618 commit c0a7d55Copy full SHA for c0a7d55
src/test/run-pass/unboxed-closures-move-mutable.rs
@@ -14,7 +14,9 @@
14
// Test that mutating a mutable upvar in a capture-by-value unboxed
15
// closure does not ice (issue #18238) and marks the upvar as used
16
// mutably so we do not get a spurious warning about it not needing to
17
-// be declared mutable (issue #18336).
+// be declared mutable (issue #18336 and #18769)
18
+
19
+fn set(x: &mut uint) { *x = 42; }
20
21
fn main() {
22
{
@@ -25,4 +27,12 @@ fn main() {
25
27
let mut x = 0u;
26
28
move |:| x += 1;
29
}
30
+ {
31
+ let mut x = 0u;
32
+ move |&mut:| set(&mut x);
33
+ }
34
35
36
+ move |:| set(&mut x);
37
38
0 commit comments