]> git.lizzy.rs Git - rust.git/blob - src/test/ui/privacy/union-field-privacy-2.rs
Rollup merge of #92467 - Aaron1011:extern-local-region, r=oli-obk
[rust.git] / src / test / ui / privacy / union-field-privacy-2.rs
1 mod m {
2     pub union U {
3         pub a: u8,
4         pub(super) b: u8,
5         c: u8,
6     }
7 }
8
9 fn main() {
10     let u = m::U { a: 10 };
11
12     let a = u.a; // OK
13     let b = u.b; // OK
14     let c = u.c; //~ ERROR field `c` of union `U` is private
15 }