mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
982b49494e
This is to make the diff when stabilizing it easier to review.
13 lines
316 B
Rust
13 lines
316 B
Rust
#![allow(unused_variables)]
|
|
|
|
union Foo {
|
|
bar: i8,
|
|
baz: u8,
|
|
}
|
|
|
|
fn main() {
|
|
let foo = Foo { bar: 5 };
|
|
let a = foo.bar; //~ ERROR access to union field is unsafe and requires unsafe function or block
|
|
let b = foo.baz; //~ ERROR access to union field is unsafe and requires unsafe function or block
|
|
}
|