blob: 94cee4eff2c38a72d2c3fdc5b6d1d2723b8c4ac4 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
mod cat {
pub struct Cat {
meows: usize
}
pub fn new_cat() -> Cat {
Cat { meows: 52 }
}
}
fn main() {
let nyan = cat::new_cat();
assert_eq!(nyan.meows, 52); //~ ERROR field `meows` of struct `Cat` is private
}
|