]> git.lizzy.rs Git - rust.git/blob - src/test/ui/parser/struct-literal-in-match-guard.rs
Merge 'rust-clippy/master' into clippyup
[rust.git] / src / test / 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() {}