1 // produce special borrowck message inside all kinds of loops
3 struct FuncWrapper<'a, T : 'a> {
4 func : fn(&'a mut T) -> ()
7 impl<'a, T : 'a> FuncWrapper<'a, T> {
8 fn in_loop(self, arg : &'a mut T) {
10 (self.func)(arg) //~ ERROR cannot borrow
14 fn in_while(self, arg : &'a mut T) {
15 while true { //~ WARN denote infinite loops with
16 (self.func)(arg) //~ ERROR cannot borrow
20 fn in_for(self, arg : &'a mut T) {
21 let v : Vec<()> = vec![];
23 (self.func)(arg) //~ ERROR cannot borrow