mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-28 01:34:21 +00:00
19 lines
236 B
Rust
19 lines
236 B
Rust
struct S {
|
|
a: u8,
|
|
}
|
|
|
|
union U {
|
|
a: u8,
|
|
}
|
|
|
|
fn main() {
|
|
unsafe {
|
|
let mut s: S;
|
|
let mut u: U;
|
|
s.a = 0; //~ ERROR E0381
|
|
u.a = 0; //~ ERROR E0381
|
|
let sa = s.a;
|
|
let ua = u.a;
|
|
}
|
|
}
|