2020-12-05 15:12:39 -06:00
|
|
|
#![feature(if_let_guard)]
|
|
|
|
|
2019-01-11 21:10:59 -06:00
|
|
|
#![deny(irrefutable_let_patterns)]
|
|
|
|
|
|
|
|
fn main() {
|
2021-02-17 04:26:38 -06:00
|
|
|
if let _ = 5 {} //~ ERROR irrefutable `if let` pattern
|
2019-01-11 21:10:59 -06:00
|
|
|
|
2021-02-17 04:26:38 -06:00
|
|
|
while let _ = 5 { //~ ERROR irrefutable `while let` pattern
|
2019-01-11 21:10:59 -06:00
|
|
|
break;
|
|
|
|
}
|
2020-12-05 15:12:39 -06:00
|
|
|
|
|
|
|
match 5 {
|
|
|
|
_ if let _ = 2 => {} //~ ERROR irrefutable `if let` guard pattern
|
|
|
|
_ => {}
|
|
|
|
}
|
2019-01-11 21:10:59 -06:00
|
|
|
}
|