Closed
Description
#[derive(Copy, Clone)]
pub struct B;
mod a {
pub union U {
pub a: i32,
b: crate::B,
}
}
fn new(a: i32) -> B {
unsafe { a::U { a }.b }
}
Errors:
Compiling playground v0.0.1 (/playground)
error[E0616]: field `b` of struct `a::U` is private
--> src/lib.rs:12:14
|
12 | unsafe { a::U { a }.b }
| ^^^^^^^^^^^^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0616`.
error: Could not compile `playground`.
To learn more, run the command again with --verbose.
Notice how it says "struct" when it should say "union".
cc @estebank this looks like low-hanging fruit