]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/suggest-local-var-imm-and-mut.stderr
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / ui / borrowck / suggest-local-var-imm-and-mut.stderr
1 error[E0502]: cannot borrow `*self` as mutable because it is also borrowed as immutable
2   --> $DIR/suggest-local-var-imm-and-mut.rs:12:22
3    |
4 LL |             self.foo(self.bar());
5    |             ---------^^^^^^^^^^-
6    |             |    |   |
7    |             |    |   mutable borrow occurs here
8    |             |    immutable borrow later used by call
9    |             immutable borrow occurs here
10
11 error[E0502]: cannot borrow `*self` as mutable because it is also borrowed as immutable
12   --> $DIR/suggest-local-var-imm-and-mut.rs:24:29
13    |
14 LL |             Self::foo(self, Self::bar(self));
15    |             --------- ----  ^^^^^^^^^^^^^^^ mutable borrow occurs here
16    |             |         |
17    |             |         immutable borrow occurs here
18    |             immutable borrow later used by call
19
20 error: aborting due to 2 previous errors
21
22 For more information about this error, try `rustc --explain E0502`.