mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 15:23:46 +00:00
22 lines
412 B
Rust
22 lines
412 B
Rust
#![feature(if_let_guard)]
|
|
|
|
#[deny(irrefutable_let_patterns)]
|
|
fn irrefutable_let_guard() {
|
|
match Some(()) {
|
|
Some(x) if let () = x => {}
|
|
//~^ ERROR irrefutable `if let` guard
|
|
_ => {}
|
|
}
|
|
}
|
|
|
|
#[deny(unreachable_patterns)]
|
|
fn unreachable_pattern() {
|
|
match Some(()) {
|
|
x if let None | None = x => {}
|
|
//~^ ERROR unreachable pattern
|
|
_ => {}
|
|
}
|
|
}
|
|
|
|
fn main() {}
|