rust/tests/ui/reachable/unreachable-loop-patterns.rs
2024-08-10 12:07:17 +02:00

19 lines
320 B
Rust

#![feature(never_type, never_type_fallback)]
#![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
}