blob: aa588d8acaf71b57c6d12f46335569e0ae9ec192 [file] [log] [blame]
error[E0594]: cannot assign to field `self.how_hungry` of immutable binding
--> $DIR/mutable-class-fields-2.rs:19:5
|
LL | pub fn eat(&self) {
| ----- use `&mut self` here to make mutable
LL | self.how_hungry -= 5; //~ ERROR cannot assign
| ^^^^^^^^^^^^^^^^^^^^ cannot mutably borrow field of immutable binding
error: aborting due to previous error
For more information about this error, try `rustc --explain E0594`.