summary refs log tree commit diff
path: root/src/test/ui/mut/mutable-class-fields-2.stderr
blob: b0dea3082dda01653d3ae443dee0c467380c19f9 (plain)
1
2
3
4
5
6
7
8
9
10
11
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`.