]> git.lizzy.rs Git - rust.git/commitdiff
Fix unit test that was illegally mutating an upvar
authorBrian Koropoff <bkoropoff@gmail.com>
Sat, 4 Oct 2014 22:34:38 +0000 (15:34 -0700)
committerBrian Koropoff <bkoropoff@gmail.com>
Sun, 5 Oct 2014 07:26:06 +0000 (00:26 -0700)
src/test/run-pass/unboxed-closures-by-ref.rs

index 2ee28d19b75a986fa614c6672f82895f2a4b8cd0..70d41a5c68909c984623be69a32e12b469a58135 100644 (file)
@@ -28,8 +28,8 @@ fn main() {
     let mut x = 0u;
     let y = 2u;
 
-    call_fn(|&:| x += y);
+    call_fn(|&:| assert_eq!(x, 0));
     call_fn_mut(|&mut:| x += y);
     call_fn_once(|:| x += y);
-    assert_eq!(x, y * 3);
+    assert_eq!(x, y * 2);
 }