]> git.proxmox.com Git - rustc.git/blob - tests/ui/rfc-2497-if-let-chains/ast-validate-guards.rs
New upstream version 1.71.1+dfsg1
[rustc.git] / tests / ui / rfc-2497-if-let-chains / ast-validate-guards.rs
1 #![feature(let_chains)]
2
3 fn let_or_guard(x: Result<Option<i32>, ()>) {
4 match x {
5 Ok(opt) if let Some(4) = opt || false => {}
6 //~^ ERROR `let` expressions are not supported here
7 _ => {}
8 }
9 }
10
11 fn hiding_unsafe_mod(x: Result<Option<i32>, ()>) {
12 match x {
13 Ok(opt)
14 if {
15 unsafe mod a {};
16 //~^ ERROR module cannot be declared unsafe
17 false
18 } => {}
19 _ => {}
20 }
21 }
22
23 fn main() {}