mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-14 09:36:06 +00:00
19 lines
377 B
Rust
19 lines
377 B
Rust
#![feature(if_let_guard)]
|
|
#![allow(irrefutable_let_patterns)]
|
|
|
|
fn match_option(x: Option<u32>) {
|
|
match x {
|
|
//~^ ERROR non-exhaustive patterns: `None` not covered
|
|
Some(_) => {}
|
|
None if let y = x => {}
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
let x = ();
|
|
match x {
|
|
//~^ ERROR non-exhaustive patterns: `()` not covered
|
|
y if let z = y => {}
|
|
}
|
|
}
|