mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-05 21:24:12 +00:00
22 lines
518 B
Rust
22 lines
518 B
Rust
// aux-build:uninhabited.rs
|
|
#![deny(unreachable_patterns)]
|
|
#![feature(never_type)]
|
|
|
|
extern crate uninhabited;
|
|
|
|
use uninhabited::PartiallyInhabitedVariants;
|
|
|
|
// This test checks a redundant/useless pattern of a non-exhaustive enum/variant is still
|
|
// warned against.
|
|
|
|
pub fn foo(x: PartiallyInhabitedVariants) {
|
|
match x {
|
|
PartiallyInhabitedVariants::Struct { .. } => {},
|
|
PartiallyInhabitedVariants::Struct { .. } => {},
|
|
//~^ ERROR unreachable pattern
|
|
_ => {},
|
|
}
|
|
}
|
|
|
|
fn main() { }
|