summaryrefslogtreecommitdiffstats
path: root/src/test/ui/reachable/unreachable-loop-patterns.rs
blob: e9cef5f47d4aa555e6c8e010c5f4c17cbfe8b858 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#![feature(never_type, never_type_fallback)]
#![feature(exhaustive_patterns)]

#![allow(unreachable_code)]
#![deny(unreachable_patterns)]

enum Void {}

impl Iterator for Void {
    type Item = Void;

    fn next(&mut self) -> Option<Void> {
        None
    }
}

fn main() {
    for _ in unimplemented!() as Void {}
    //~^ ERROR unreachable pattern
}