diff options
Diffstat (limited to 'src/test/ui/borrowck/borrowck-autoref-3261.rs')
-rw-r--r-- | src/test/ui/borrowck/borrowck-autoref-3261.rs | 24 |
1 files changed, 0 insertions, 24 deletions
diff --git a/src/test/ui/borrowck/borrowck-autoref-3261.rs b/src/test/ui/borrowck/borrowck-autoref-3261.rs deleted file mode 100644 index 2ff3d5bd3..000000000 --- a/src/test/ui/borrowck/borrowck-autoref-3261.rs +++ /dev/null @@ -1,24 +0,0 @@ -enum Either<T, U> { Left(T), Right(U) } - -struct X(Either<(usize,usize), fn()>); - -impl X { - pub fn with<F>(&self, blk: F) where F: FnOnce(&Either<(usize, usize), fn()>) { - let X(ref e) = *self; - blk(e) - } -} - -fn main() { - let mut x = X(Either::Right(main as fn())); - (&mut x).with( - |opt| { //~ ERROR cannot borrow `x` as mutable more than once at a time - match opt { - &Either::Right(ref f) => { - x = X(Either::Left((0, 0))); - (*f)() - }, - _ => panic!() - } - }) -} |