]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/suggest-local-var-double-mut.stderr
Auto merge of #98051 - davidtwco:split-dwarf-stabilization, r=wesleywiser
[rust.git] / src / test / ui / borrowck / suggest-local-var-double-mut.stderr
1 error[E0499]: cannot borrow `*self` as mutable more than once at a time
2   --> $DIR/suggest-local-var-double-mut.rs:12:22
3    |
4 LL |             self.foo(self.bar());
5    |             ---------^^^^^^^^^^-
6    |             |    |   |
7    |             |    |   second mutable borrow occurs here
8    |             |    first borrow later used by call
9    |             first mutable borrow occurs here
10    |
11 help: try adding a local storing this argument...
12   --> $DIR/suggest-local-var-double-mut.rs:12:22
13    |
14 LL |             self.foo(self.bar());
15    |                      ^^^^^^^^^^
16 help: ...and then using that local as the argument to this call
17   --> $DIR/suggest-local-var-double-mut.rs:12:13
18    |
19 LL |             self.foo(self.bar());
20    |             ^^^^^^^^^^^^^^^^^^^^
21
22 error[E0499]: cannot borrow `*self` as mutable more than once at a time
23   --> $DIR/suggest-local-var-double-mut.rs:24:39
24    |
25 LL |             Self::foo(self, Self::bar(self));
26    |             --------- ----            ^^^^ second mutable borrow occurs here
27    |             |         |
28    |             |         first mutable borrow occurs here
29    |             first borrow later used by call
30    |
31 help: try adding a local storing this argument...
32   --> $DIR/suggest-local-var-double-mut.rs:24:29
33    |
34 LL |             Self::foo(self, Self::bar(self));
35    |                             ^^^^^^^^^^^^^^^
36 help: ...and then using that local as the argument to this call
37   --> $DIR/suggest-local-var-double-mut.rs:24:13
38    |
39 LL |             Self::foo(self, Self::bar(self));
40    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
41
42 error: aborting due to 2 previous errors
43
44 For more information about this error, try `rustc --explain E0499`.