summaryrefslogtreecommitdiffstats
path: root/src/test/ui/structs-enums/functional-struct-upd.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/test/ui/structs-enums/functional-struct-upd.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/test/ui/structs-enums/functional-struct-upd.rs b/src/test/ui/structs-enums/functional-struct-upd.rs
new file mode 100644
index 000000000..68ff73a08
--- /dev/null
+++ b/src/test/ui/structs-enums/functional-struct-upd.rs
@@ -0,0 +1,15 @@
+// run-pass
+
+#![allow(dead_code)]
+
+#[derive(Debug)]
+struct Foo {
+ x: isize,
+ y: isize
+}
+
+pub fn main() {
+ let a = Foo { x: 1, y: 2 };
+ let c = Foo { x: 4, .. a};
+ println!("{:?}", c);
+}