2023-05-22 08:52:52 -05:00
|
|
|
#![feature(let_chains)]
|
|
|
|
|
|
|
|
fn let_or_guard(x: Result<Option<i32>, ()>) {
|
|
|
|
match x {
|
|
|
|
Ok(opt) if let Some(4) = opt || false => {}
|
2023-09-08 05:14:36 -05:00
|
|
|
//~^ ERROR expected expression, found `let` statement
|
2023-05-22 08:52:52 -05:00
|
|
|
_ => {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn hiding_unsafe_mod(x: Result<Option<i32>, ()>) {
|
|
|
|
match x {
|
|
|
|
Ok(opt)
|
|
|
|
if {
|
|
|
|
unsafe mod a {};
|
|
|
|
//~^ ERROR module cannot be declared unsafe
|
|
|
|
false
|
|
|
|
} => {}
|
|
|
|
_ => {}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {}
|