summary refs log tree commit diff
path: root/src/test/ui/privacy/union-field-privacy-2.rs
blob: c2458f74bc8f91ed959cf0b04b31b43e71733456 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
mod m {
    pub union U {
        pub a: u8,
        pub(super) b: u8,
        c: u8,
    }
}

fn main() {
    let u = m::U { a: 10 };

    let a = u.a; // OK
    let b = u.b; // OK
    let c = u.c; //~ ERROR field `c` of union `m::U` is private
}