We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 5689a7b + 32a31d8 commit 6c0dedbCopy full SHA for 6c0dedb
src/test/ui/typeck/issue-96530.rs
@@ -0,0 +1,20 @@
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
src/test/ui/typeck/issue-96530.stderr
@@ -0,0 +1,9 @@
+error[E0308]: mismatched types
+ --> $DIR/issue-96530.rs:9:11
+ |
+LL | ..man.clone()
+ | ^^^^^^^^^^^ expected struct `Person`, found `&Person`
+error: aborting due to previous error
+For more information about this error, try `rustc --explain E0308`.
0 commit comments