]>
Commit | Line | Data |
---|---|---|
a7813a04 XL |
1 | struct Dog { |
2 | name: String, | |
3 | age: u32, | |
4 | } | |
5 | ||
5869c6ff | 6 | |
a7813a04 XL |
7 | fn main() { |
8 | let d = Dog { name: "Rusty".to_string(), age: 8 }; | |
9 | ||
10 | match d { | |
1b1a35ee XL |
11 | Dog { age: x } => {} //~ ERROR pattern does not mention field `name` |
12 | } | |
5869c6ff XL |
13 | match d { |
14 | // trailing comma | |
15 | Dog { name: x, } => {} //~ ERROR pattern does not mention field `age` | |
16 | } | |
17 | match d { | |
18 | // trailing comma with weird whitespace | |
19 | Dog { name: x , } => {} //~ ERROR pattern does not mention field `age` | |
20 | } | |
1b1a35ee XL |
21 | match d { |
22 | Dog {} => {} //~ ERROR pattern does not mention fields `name`, `age` | |
54a0048b SL |
23 | } |
24 | } |