rust/src/test/ui/reachable/unreachable-loop-patterns.rs

22 lines
378 B
Rust
Raw Normal View History

#![feature(never_type_fallback)]
#![feature(exhaustive_patterns)]
2018-11-20 16:49:48 -06:00
#![allow(unreachable_code)]
#![deny(unreachable_patterns)]
2018-11-20 16:49:48 -06:00
enum Void {}
impl Iterator for Void {
type Item = Void;
2018-11-20 16:49:48 -06:00
fn next(&mut self) -> Option<Void> {
None
}
}
fn main() {
for _ in unimplemented!() as Void {}
//~^ ERROR unreachable pattern
2019-05-23 15:39:36 -05:00
//~^^ ERROR unreachable pattern
}