Skip to content

Commit

Permalink
Test that functional struct update exprs get rejected if...
Browse files Browse the repository at this point in the history
...they require copying noncopyable fields.
  • Loading branch information
catamorphism committed Oct 13, 2012
1 parent 71dbbe1 commit 632d606
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/test/compile-fail/functional-struct-update.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
struct Bar {
x: int,
drop { io::println("Goodbye, cruel world"); }
}

struct Foo {
x: int,
y: Bar
}

fn main() {
let a = Foo { x: 1, y: Bar { x: 5 } };
let c = Foo { x: 4, .. a}; //~ ERROR copying a noncopyable value
io::println(fmt!("%?", c));
}

0 comments on commit 632d606

Please sign in to comment.