summaryrefslogtreecommitdiffstats
path: root/tests/ui/typeck/issue-96530.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/ui/typeck/issue-96530.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/ui/typeck/issue-96530.rs b/tests/ui/typeck/issue-96530.rs
new file mode 100644
index 000000000..4ab93ab49
--- /dev/null
+++ b/tests/ui/typeck/issue-96530.rs
@@ -0,0 +1,20 @@
+struct Person {
+ first_name: String,
+ age: u32,
+}
+
+fn first_woman(man: &Person) -> Person {
+ Person {
+ first_name: "Eve".to_string(),
+ ..man.clone() //~ ERROR: mismatched types
+ }
+}
+
+fn main() {
+ let adam = Person {
+ first_name: "Adam".to_string(),
+ age: 0,
+ };
+
+ let eve = first_woman(&adam);
+}