diff options
Diffstat (limited to 'src/test/ui/borrowck/borrowck-closures-mut-of-mut.rs')
-rw-r--r-- | src/test/ui/borrowck/borrowck-closures-mut-of-mut.rs | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/src/test/ui/borrowck/borrowck-closures-mut-of-mut.rs b/src/test/ui/borrowck/borrowck-closures-mut-of-mut.rs deleted file mode 100644 index 50c6f2c58..000000000 --- a/src/test/ui/borrowck/borrowck-closures-mut-of-mut.rs +++ /dev/null @@ -1,20 +0,0 @@ -// Tests that two closures cannot simultaneously both have mutable -// access to the variable. Related to issue #6801. - -fn get(x: &isize) -> isize { - *x -} - -fn set(x: &mut isize) { - *x = 4; -} - -fn a(x: &mut isize) { - let mut c1 = || set(&mut *x); - let mut c2 = || set(&mut *x); - //~^ ERROR two closures require unique access to `x` at the same time - c2(); c1(); -} - -fn main() { -} |