diff options
Diffstat (limited to 'tests/ui/structs-enums/functional-struct-upd.rs')
-rw-r--r-- | tests/ui/structs-enums/functional-struct-upd.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/ui/structs-enums/functional-struct-upd.rs b/tests/ui/structs-enums/functional-struct-upd.rs new file mode 100644 index 000000000..68ff73a08 --- /dev/null +++ b/tests/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); +} |