2019-04-22 02:40:08 -05:00
|
|
|
error[E0596]: cannot borrow `self` as mutable, as it is not declared as mutable
|
|
|
|
--> $DIR/issue-31424.rs:7:9
|
2016-11-02 01:15:02 -05:00
|
|
|
|
|
2021-03-17 20:45:49 -05:00
|
|
|
LL | (&mut self).bar();
|
|
|
|
| ^^^^^^^^^^^ cannot borrow as mutable
|
|
|
|
|
|
|
|
|
note: the binding is already a mutable borrow
|
|
|
|
--> $DIR/issue-31424.rs:6:12
|
|
|
|
|
|
|
|
|
LL | fn foo(&mut self) {
|
|
|
|
| ^^^^^^^^^
|
|
|
|
help: try removing `&mut` here
|
|
|
|
--> $DIR/issue-31424.rs:7:9
|
|
|
|
|
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | (&mut self).bar();
|
2019-04-22 02:40:08 -05:00
|
|
|
| ^^^^^^^^^^^
|
2016-11-02 01:15:02 -05:00
|
|
|
|
2018-09-11 20:35:08 -05:00
|
|
|
warning: function cannot return without recursing
|
2021-07-25 09:23:48 -05:00
|
|
|
--> $DIR/issue-31424.rs:13:5
|
2018-09-11 20:35:08 -05:00
|
|
|
|
|
|
|
|
LL | fn bar(self: &mut Self) {
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^ cannot return without recursing
|
2021-07-25 09:23:48 -05:00
|
|
|
...
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | (&mut self).bar();
|
2018-09-11 20:35:08 -05:00
|
|
|
| ----------------- recursive call site
|
|
|
|
|
|
|
|
|
= help: a `loop` may express intention better if this is on purpose
|
2022-09-18 10:55:36 -05:00
|
|
|
= note: `#[warn(unconditional_recursion)]` on by default
|
2018-09-11 20:35:08 -05:00
|
|
|
|
2019-04-22 02:40:08 -05:00
|
|
|
error[E0596]: cannot borrow `self` as mutable, as it is not declared as mutable
|
2021-07-25 09:23:48 -05:00
|
|
|
--> $DIR/issue-31424.rs:16:9
|
2016-11-02 01:15:02 -05:00
|
|
|
|
|
2021-03-17 20:45:49 -05:00
|
|
|
LL | (&mut self).bar();
|
|
|
|
| ^^^^^^^^^^^ cannot borrow as mutable
|
|
|
|
|
|
|
|
|
note: the binding is already a mutable borrow
|
|
|
|
--> $DIR/issue-31424.rs:13:18
|
|
|
|
|
|
|
|
|
LL | fn bar(self: &mut Self) {
|
|
|
|
| ^^^^^^^^^
|
|
|
|
help: try removing `&mut` here
|
|
|
|
--> $DIR/issue-31424.rs:16:9
|
|
|
|
|
|
2019-03-09 06:03:44 -06:00
|
|
|
LL | (&mut self).bar();
|
2019-04-22 02:40:08 -05:00
|
|
|
| ^^^^^^^^^^^
|
2016-11-02 01:15:02 -05:00
|
|
|
|
2020-03-11 10:30:09 -05:00
|
|
|
error: aborting due to 2 previous errors; 1 warning emitted
|
2016-11-02 01:15:02 -05:00
|
|
|
|
2018-03-03 08:59:40 -06:00
|
|
|
For more information about this error, try `rustc --explain E0596`.
|