summary refs log tree commit diff
path: root/src/test/ui/error-codes/E0027.rs
blob: 8d08e178934807125a85140a0807a5edc7123287 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
struct Dog {
    name: String,
    age: u32,
}

fn main() {
    let d = Dog { name: "Rusty".to_string(), age: 8 };

    match d {
        Dog { age: x } => {} //~ ERROR pattern does not mention field `name`
    }
    match d {
        Dog {} => {} //~ ERROR pattern does not mention fields `name`, `age`
    }
}