]> git.lizzy.rs Git - rust.git/blob - src/test/ui/nll/issue-51191.stderr
Auto merge of #54720 - davidtwco:issue-51191, r=nikomatsakis
[rust.git] / src / test / ui / nll / issue-51191.stderr
1 error[E0596]: cannot borrow `self` as mutable, as it is not declared as mutable
2   --> $DIR/issue-51191.rs:17:9
3    |
4 LL |         (&mut self).bar();
5    |         ^^^^^^^^^^^
6    |         |
7    |         cannot borrow as mutable
8    |         try removing `&mut` here
9
10 error[E0596]: cannot borrow `self` as mutable, as it is not declared as mutable
11   --> $DIR/issue-51191.rs:22:9
12    |
13 LL |     fn imm(self) {
14    |            ---- help: consider changing this to be mutable: `mut self`
15 LL |         (&mut self).bar();
16    |         ^^^^^^^^^^^ cannot borrow as mutable
17
18 error[E0596]: cannot borrow `self` as mutable, as it is not declared as mutable
19   --> $DIR/issue-51191.rs:31:9
20    |
21 LL |         (&mut self).bar();
22    |         ^^^^^^^^^^^ cannot borrow as mutable
23
24 error[E0596]: cannot borrow data in a `&` reference as mutable
25   --> $DIR/issue-51191.rs:31:9
26    |
27 LL |         (&mut self).bar();
28    |         ^^^^^^^^^^^ cannot borrow as mutable
29
30 error[E0596]: cannot borrow `self` as mutable, as it is not declared as mutable
31   --> $DIR/issue-51191.rs:37:9
32    |
33 LL |         (&mut self).bar();
34    |         ^^^^^^^^^^^
35    |         |
36    |         cannot borrow as mutable
37    |         try removing `&mut` here
38
39 error: aborting due to 5 previous errors
40
41 For more information about this error, try `rustc --explain E0596`.