rust/src/test/ui/mut/mutable-class-fields-2.stderr
Vadim Petrochenkov fa72a81bea Update tests
2019-03-11 23:10:26 +03:00

12 lines
428 B
Plaintext

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