]> git.lizzy.rs Git - rust.git/blob - src/test/ui/privacy/private-struct-field.rs
Rollup merge of #92467 - Aaron1011:extern-local-region, r=oli-obk
[rust.git] / src / test / ui / privacy / private-struct-field.rs
1 mod cat {
2     pub struct Cat {
3         meows: usize
4     }
5
6     pub fn new_cat() -> Cat {
7         Cat { meows: 52 }
8     }
9 }
10
11 fn main() {
12     let nyan = cat::new_cat();
13     assert_eq!(nyan.meows, 52);    //~ ERROR field `meows` of struct `Cat` is private
14 }