]> git.lizzy.rs Git - rust.git/blob - src/test/ui/typeck/issue-96530.rs
Merge from rustc
[rust.git] / src / test / ui / typeck / issue-96530.rs
1 struct Person {
2     first_name: String,
3     age: u32,
4 }
5
6 fn first_woman(man: &Person) -> Person {
7     Person {
8         first_name: "Eve".to_string(),
9         ..man.clone() //~ ERROR: mismatched types
10     }
11 }
12
13 fn main() {
14     let adam = Person {
15         first_name: "Adam".to_string(),
16         age: 0,
17     };
18
19     let eve = first_woman(&adam);
20 }