mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-27 17:24:06 +00:00
31 lines
512 B
Rust
31 lines
512 B
Rust
#![feature(never_type)]
|
|
#![feature(exhaustive_patterns)]
|
|
|
|
mod foo {
|
|
pub struct SecretlyEmpty {
|
|
_priv: !,
|
|
}
|
|
|
|
pub struct NotSoSecretlyEmpty {
|
|
pub _pub: !,
|
|
}
|
|
}
|
|
|
|
struct NotSoSecretlyEmpty {
|
|
_priv: !,
|
|
}
|
|
|
|
enum Foo {
|
|
A(foo::SecretlyEmpty),
|
|
B(foo::NotSoSecretlyEmpty),
|
|
C(NotSoSecretlyEmpty),
|
|
D(u32, u32),
|
|
}
|
|
|
|
fn main() {
|
|
let x: Foo = Foo::D(123, 456);
|
|
let Foo::D(_y, _z) = x;
|
|
//~^ ERROR refutable pattern in local binding
|
|
//~| `Foo::A(_)` not covered
|
|
}
|