Closed
Description
// Playpen Link: http://is.gd/2baYh8
struct Struct;
impl Struct {
fn foo(&mut self) {
(&mut self).bar();
}
fn bar(&mut self) {}
}
fn main () {}
Output:
<anon>:5:15: 5:19 error: cannot borrow immutable argument `self` as mutable
<anon>:5 (&mut self).bar();
^~~~
<anon>:4:17: 4:21 help: to make the argument mutable, use `mut` as shown:
<anon>: fn foo(&mut mut self) {
error: aborting due to previous error
playpen: application terminated with error code 101