Skip to content

Commit 16b27bb

Browse files
committed
Fix unit test that was illegally mutating an upvar
1 parent f74b1c4 commit 16b27bb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/test/run-pass/unboxed-closures-by-ref.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ fn main() {
2828
let mut x = 0u;
2929
let y = 2u;
3030

31-
call_fn(|&:| x += y);
31+
call_fn(|&:| assert_eq!(x, 0));
3232
call_fn_mut(|&mut:| x += y);
3333
call_fn_once(|:| x += y);
34-
assert_eq!(x, y * 3);
34+
assert_eq!(x, y * 2);
3535
}

0 commit comments

Comments
 (0)