2018-11-20 22:49:48 +00:00
|
|
|
// compile-fail
|
|
|
|
|
2018-04-20 17:07:58 +02:00
|
|
|
#![feature(never_type)]
|
2018-01-21 16:44:41 +08:00
|
|
|
#![feature(exhaustive_patterns)]
|
2018-11-20 22:49:48 +00:00
|
|
|
|
|
|
|
#![allow(unreachable_code)]
|
2017-01-17 21:32:27 +08:00
|
|
|
#![deny(unreachable_patterns)]
|
|
|
|
|
2018-11-20 22:49:48 +00:00
|
|
|
enum Void {}
|
|
|
|
|
|
|
|
impl Iterator for Void {
|
|
|
|
type Item = Void;
|
2017-01-17 21:32:27 +08:00
|
|
|
|
2018-11-20 22:49:48 +00:00
|
|
|
fn next(&mut self) -> Option<Void> {
|
|
|
|
None
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
for _ in unimplemented!() as Void {}
|
2017-01-17 21:32:27 +08:00
|
|
|
//~^ ERROR unreachable pattern
|
|
|
|
}
|