2016-08-22 11:56:14 -05:00
|
|
|
mod m {
|
|
|
|
pub union U {
|
2016-08-26 11:23:42 -05:00
|
|
|
pub a: u8,
|
|
|
|
pub(super) b: u8,
|
|
|
|
c: u8,
|
2016-08-22 11:56:14 -05:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2016-08-26 11:23:42 -05:00
|
|
|
let u = m::U { a: 10 };
|
|
|
|
|
|
|
|
let a = u.a; // OK
|
|
|
|
let b = u.b; // OK
|
2020-09-02 02:40:56 -05:00
|
|
|
let c = u.c; //~ ERROR field `c` of union `U` is private
|
2016-08-22 11:56:14 -05:00
|
|
|
}
|