]> git.proxmox.com Git - rustc.git/blob - tests/ui/parser/struct-literal-in-match-guard.rs
New upstream version 1.68.2+dfsg1
[rustc.git] / tests / ui / parser / struct-literal-in-match-guard.rs
1 // check-pass
2
3 // Unlike `if` condition, `match` guards accept struct literals.
4 // This is detected in <https://github.com/rust-lang/rust/pull/74566#issuecomment-663613705>.
5
6 #[derive(PartialEq)]
7 struct Foo {
8 x: isize,
9 }
10
11 fn foo(f: Foo) {
12 match () {
13 () if f == Foo { x: 42 } => {}
14 _ => {}
15 }
16 }
17
18 fn main() {}