rust/tests/ui/reachable/unreachable-loop-patterns.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
358 B
Rust
Raw Normal View History

#![feature(never_type, never_type_fallback)]
#![feature(min_exhaustive_patterns)]
2018-11-20 22:49:48 +00:00
#![allow(unreachable_code)]
#![deny(unreachable_patterns)]
2018-11-20 22:49:48 +00:00
enum Void {}
impl Iterator for Void {
type Item = Void;
2018-11-20 22:49:48 +00:00
fn next(&mut self) -> Option<Void> {
None
}
}
fn main() {
for _ in unimplemented!() as Void {}
//~^ ERROR unreachable pattern
}