summary refs log tree commit diff
path: root/src/test/compile-fail/private-struct-field.rs
blob: 1ec9ffcd3067109398c7e6482193f159c77df398 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
mod cat {
    #[legacy_exports];
    struct Cat {
        priv meows: uint
    }

    fn new_cat() -> Cat {
        Cat { meows: 52 }
    }
}

fn main() {
    let nyan = cat::new_cat();
    assert nyan.meows == 52;    //~ ERROR field `meows` is private
}