mirror of
https://github.com/rust-lang/rust.git
synced 2025-06-05 11:48:30 +00:00
17 lines
291 B
Rust
17 lines
291 B
Rust
![]() |
// Make sure we consider `!` to be a union read.
|
||
|
|
||
|
#![feature(never_type, never_patterns)]
|
||
|
//~^ WARN the feature `never_patterns` is incomplete
|
||
|
|
||
|
union U {
|
||
|
a: !,
|
||
|
b: usize,
|
||
|
}
|
||
|
|
||
|
fn foo<T>(u: U) -> ! {
|
||
|
let U { a: ! } = u;
|
||
|
//~^ ERROR access to union field is unsafe
|
||
|
}
|
||
|
|
||
|
fn main() {}
|