]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/mut-borrow-in-loop.stderr
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / ui / borrowck / mut-borrow-in-loop.stderr
1 warning: denote infinite loops with `loop { ... }`
2   --> $DIR/mut-borrow-in-loop.rs:15:9
3    |
4 LL |         while true {
5    |         ^^^^^^^^^^ help: use `loop`
6    |
7    = note: `#[warn(while_true)]` on by default
8
9 error[E0499]: cannot borrow `*arg` as mutable more than once at a time
10   --> $DIR/mut-borrow-in-loop.rs:10:25
11    |
12 LL | impl<'a, T : 'a> FuncWrapper<'a, T> {
13    |      -- lifetime `'a` defined here
14 ...
15 LL |             (self.func)(arg)
16    |             ------------^^^-
17    |             |           |
18    |             |           `*arg` was mutably borrowed here in the previous iteration of the loop
19    |             argument requires that `*arg` is borrowed for `'a`
20
21 error[E0499]: cannot borrow `*arg` as mutable more than once at a time
22   --> $DIR/mut-borrow-in-loop.rs:16:25
23    |
24 LL | impl<'a, T : 'a> FuncWrapper<'a, T> {
25    |      -- lifetime `'a` defined here
26 ...
27 LL |             (self.func)(arg)
28    |             ------------^^^-
29    |             |           |
30    |             |           `*arg` was mutably borrowed here in the previous iteration of the loop
31    |             argument requires that `*arg` is borrowed for `'a`
32
33 error[E0499]: cannot borrow `*arg` as mutable more than once at a time
34   --> $DIR/mut-borrow-in-loop.rs:23:25
35    |
36 LL | impl<'a, T : 'a> FuncWrapper<'a, T> {
37    |      -- lifetime `'a` defined here
38 ...
39 LL |             (self.func)(arg)
40    |             ------------^^^-
41    |             |           |
42    |             |           `*arg` was mutably borrowed here in the previous iteration of the loop
43    |             argument requires that `*arg` is borrowed for `'a`
44
45 error: aborting due to 3 previous errors; 1 warning emitted
46
47 For more information about this error, try `rustc --explain E0499`.