-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lints
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
crumblingstatue, tjpeden and therustmonk
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lints