]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/mut-borrow-in-loop.nll.stderr
Unit test from #57866.
[rust.git] / src / test / ui / borrowck / mut-borrow-in-loop.nll.stderr
1 error[E0499]: cannot borrow `*arg` as mutable more than once at a time
2   --> $DIR/mut-borrow-in-loop.rs:10:25
3    |
4 LL | impl<'a, T : 'a> FuncWrapper<'a, T> {
5    |      -- lifetime `'a` defined here
6 ...
7 LL |             (self.func)(arg) //~ ERROR cannot borrow
8    |             ------------^^^-
9    |             |           |
10    |             |           mutable borrow starts here in previous iteration of loop
11    |             argument requires that `*arg` is borrowed for `'a`
12
13 error[E0499]: cannot borrow `*arg` as mutable more than once at a time
14   --> $DIR/mut-borrow-in-loop.rs:16:25
15    |
16 LL | impl<'a, T : 'a> FuncWrapper<'a, T> {
17    |      -- lifetime `'a` defined here
18 ...
19 LL |             (self.func)(arg) //~ ERROR cannot borrow
20    |             ------------^^^-
21    |             |           |
22    |             |           mutable borrow starts here in previous iteration of loop
23    |             argument requires that `*arg` is borrowed for `'a`
24
25 error[E0499]: cannot borrow `*arg` as mutable more than once at a time
26   --> $DIR/mut-borrow-in-loop.rs:23:25
27    |
28 LL | impl<'a, T : 'a> FuncWrapper<'a, T> {
29    |      -- lifetime `'a` defined here
30 ...
31 LL |             (self.func)(arg) //~ ERROR cannot borrow
32    |             ------------^^^-
33    |             |           |
34    |             |           mutable borrow starts here in previous iteration of loop
35    |             argument requires that `*arg` is borrowed for `'a`
36
37 error: aborting due to 3 previous errors
38
39 For more information about this error, try `rustc --explain E0499`.