]> git.lizzy.rs Git - rust.git/blob - tests/ui/privacy/private-class-field.rs
add tests for 107090
[rust.git] / tests / ui / privacy / private-class-field.rs
1 // run-pass
2 #![allow(dead_code)]
3 #![allow(non_camel_case_types)]
4
5
6 struct cat {
7     meows : usize,
8
9     how_hungry : isize,
10 }
11
12 impl cat {
13   pub fn meow_count(&mut self) -> usize { self.meows }
14 }
15
16 fn cat(in_x : usize, in_y : isize) -> cat {
17     cat {
18         meows: in_x,
19         how_hungry: in_y
20     }
21 }
22
23 pub fn main() {
24     let mut nyan : cat = cat(52, 99);
25     assert_eq!(nyan.meow_count(), 52);
26 }