]> git.proxmox.com Git - rustc.git/blob - tests/ui/structs-enums/classes-simple.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / 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 }