]> git.lizzy.rs Git - rust.git/blob - tests/ui/privacy/private-struct-field.rs
Rollup merge of #103418 - Aaron1011:macro-semicolon-future-incompat, r=davidtwco
[rust.git] / tests / 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 }