]> git.lizzy.rs Git - rust.git/blob - tests/ui/unneeded_field_pattern.rs
Merge remote-tracking branch 'origin/beta_backport' into HEAD
[rust.git] / tests / ui / unneeded_field_pattern.rs
1 #![warn(clippy::unneeded_field_pattern)]
2 #[allow(dead_code, unused)]
3
4 struct Foo {
5     a: i32,
6     b: i32,
7     c: i32,
8 }
9
10 fn main() {
11     let f = Foo { a: 0, b: 0, c: 0 };
12
13     match f {
14         Foo { a: _, b: 0, .. } => {},
15
16         Foo { a: _, b: _, c: _ } => {},
17     }
18     match f {
19         Foo { b: 0, .. } => {}, // should be OK
20         Foo { .. } => {},       // and the Force might be with this one
21     }
22 }