]> git.lizzy.rs Git - rust.git/blob - src/test/ui/structs-enums/classes-simple.rs
Rollup merge of #89468 - FabianWolff:issue-89358, r=jackh726
[rust.git] / src / test / ui / structs-enums / classes-simple.rs
1 // run-pass
2 #![allow(dead_code)]
3 #![allow(non_camel_case_types)]
4
5 struct cat {
6     meows : usize,
7
8     how_hungry : isize,
9 }
10
11 fn cat(in_x : usize, in_y : isize) -> cat {
12     cat {
13         meows: in_x,
14         how_hungry: in_y
15     }
16 }
17
18 pub fn main() {
19   let nyan : cat = cat(52, 99);
20   let kitty = cat(1000, 2);
21   assert_eq!(nyan.how_hungry, 99);
22   assert_eq!(kitty.how_hungry, 2);
23 }