summary refs log tree commit diff
path: root/src/test/ui/privacy/private-struct-field.rs
blob: 216ae20e153f5b935728b21c89f3d4bc194eb2f5 (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::Cat` is private
}