diff options
Diffstat (limited to 'src/test/ui/borrowck/mut-borrow-in-loop.rs')
-rw-r--r-- | src/test/ui/borrowck/mut-borrow-in-loop.rs | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/src/test/ui/borrowck/mut-borrow-in-loop.rs b/src/test/ui/borrowck/mut-borrow-in-loop.rs deleted file mode 100644 index 22667906e..000000000 --- a/src/test/ui/borrowck/mut-borrow-in-loop.rs +++ /dev/null @@ -1,29 +0,0 @@ -// produce special borrowck message inside all kinds of loops - -struct FuncWrapper<'a, T : 'a> { - func : fn(&'a mut T) -> () -} - -impl<'a, T : 'a> FuncWrapper<'a, T> { - fn in_loop(self, arg : &'a mut T) { - loop { - (self.func)(arg) //~ ERROR cannot borrow - } - } - - fn in_while(self, arg : &'a mut T) { - while true { //~ WARN denote infinite loops with - (self.func)(arg) //~ ERROR cannot borrow - } - } - - fn in_for(self, arg : &'a mut T) { - let v : Vec<()> = vec![]; - for _ in v.iter() { - (self.func)(arg) //~ ERROR cannot borrow - } - } -} - -fn main() { -} |