]> git.lizzy.rs Git - rust.git/blob - tests/ui/privacy/private-method.rs
Fix #106496, suggest remove deref for type mismatch
[rust.git] / tests / ui / privacy / private-method.rs
1 mod kitties {
2     pub struct Cat {
3         meows : usize,
4
5         how_hungry : isize,
6     }
7
8     impl Cat {
9         fn nap(&self) {}
10     }
11
12     pub fn cat(in_x : usize, in_y : isize) -> Cat {
13         Cat {
14             meows: in_x,
15             how_hungry: in_y
16         }
17     }
18 }
19
20 fn main() {
21   let nyan : kitties::Cat = kitties::cat(52, 99);
22   nyan.nap(); //~ ERROR associated function `nap` is private
23 }