]> git.lizzy.rs Git - rust.git/blob - tests/ui/typeck/issue-96530.rs
Rollup merge of #106788 - estebank:elaborate_pred_E0599, r=compiler-errors
[rust.git] / tests / 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 }