summaryrefslogtreecommitdiffstats
path: root/src/test/ui/rfc-2008-non-exhaustive/uninhabited/issue-65157-repeated-match-arm.rs
blob: 230ac75298e726b850eb9d27c918c4e14bf5bdbe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
// 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() { }