]> git.lizzy.rs Git - rust.git/blob - src/test/ui/did_you_mean/issue-31424.stderr
Test `expect` with `forbid` and fix doc errors (RFC-2383)
[rust.git] / src / test / ui / did_you_mean / issue-31424.stderr
1 error[E0596]: cannot borrow `self` as mutable, as it is not declared as mutable
2   --> $DIR/issue-31424.rs:7:9
3    |
4 LL |         (&mut self).bar();
5    |         ^^^^^^^^^^^ cannot borrow as mutable
6    |
7 note: the binding is already a mutable borrow
8   --> $DIR/issue-31424.rs:6:12
9    |
10 LL |     fn foo(&mut self) {
11    |            ^^^^^^^^^
12 help: try removing `&mut` here
13   --> $DIR/issue-31424.rs:7:9
14    |
15 LL |         (&mut self).bar();
16    |         ^^^^^^^^^^^
17
18 warning: function cannot return without recursing
19   --> $DIR/issue-31424.rs:13:5
20    |
21 LL |     fn bar(self: &mut Self) {
22    |     ^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
23 ...
24 LL |         (&mut self).bar();
25    |         ----------------- recursive call site
26    |
27    = note: `#[warn(unconditional_recursion)]` on by default
28    = help: a `loop` may express intention better if this is on purpose
29
30 error[E0596]: cannot borrow `self` as mutable, as it is not declared as mutable
31   --> $DIR/issue-31424.rs:16:9
32    |
33 LL |         (&mut self).bar();
34    |         ^^^^^^^^^^^ cannot borrow as mutable
35    |
36 note: the binding is already a mutable borrow
37   --> $DIR/issue-31424.rs:13:18
38    |
39 LL |     fn bar(self: &mut Self) {
40    |                  ^^^^^^^^^
41 help: try removing `&mut` here
42   --> $DIR/issue-31424.rs:16:9
43    |
44 LL |         (&mut self).bar();
45    |         ^^^^^^^^^^^
46
47 error: aborting due to 2 previous errors; 1 warning emitted
48
49 For more information about this error, try `rustc --explain E0596`.