]> git.lizzy.rs Git - rust.git/blob - src/test/ui/mut/mutable-class-fields.rs
Rollup merge of #67749 - gilescope:keyword-in, r=Dylan-DPC
[rust.git] / src / test / ui / mut / mutable-class-fields.rs
1 struct Cat {
2   meows : usize,
3   how_hungry : isize,
4 }
5
6 fn cat(in_x : usize, in_y : isize) -> Cat {
7     Cat {
8         meows: in_x,
9         how_hungry: in_y
10     }
11 }
12
13 fn main() {
14   let nyan : Cat = cat(52, 99);
15   nyan.how_hungry = 0; //~ ERROR cannot assign
16 }