]> git.lizzy.rs Git - rust.git/blob - src/test/ui/rfc-2008-non-exhaustive/uninhabited/issue-65157-repeated-match-arm.rs
0096e2963007a442f05c70aea27779619cccba9e
[rust.git] / src / test / ui / rfc-2008-non-exhaustive / uninhabited / issue-65157-repeated-match-arm.rs
1 // aux-build:uninhabited.rs
2 #![deny(unreachable_patterns)]
3 #![feature(never_type)]
4 #![feature(non_exhaustive)]
5
6 extern crate uninhabited;
7
8 use uninhabited::PartiallyInhabitedVariants;
9
10 // This test checks a redundant/useless pattern of a non-exhaustive enum/variant is still
11 // warned against.
12
13 pub fn foo(x: PartiallyInhabitedVariants) {
14     match x {
15         PartiallyInhabitedVariants::Struct { .. } => {},
16         PartiallyInhabitedVariants::Struct { .. } => {},
17         //~^ ERROR unreachable pattern
18         _ => {},
19     }
20 }
21
22 fn main() { }