2020-11-15 16:42:48 -06:00
|
|
|
#![feature(if_let_guard)]
|
|
|
|
|
|
|
|
#[deny(irrefutable_let_patterns)]
|
|
|
|
fn irrefutable_let_guard() {
|
|
|
|
match Some(()) {
|
|
|
|
Some(x) if let () = x => {}
|
2021-02-17 04:26:38 -06:00
|
|
|
//~^ ERROR irrefutable `if let` guard
|
2020-11-15 16:42:48 -06:00
|
|
|
_ => {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#[deny(unreachable_patterns)]
|
|
|
|
fn unreachable_pattern() {
|
|
|
|
match Some(()) {
|
|
|
|
x if let None | None = x => {}
|
|
|
|
//~^ ERROR unreachable pattern
|
|
|
|
_ => {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|