rust/src/test/compile-fail/pinned-deep-copy.rs
2011-09-28 15:35:21 -07:00

15 lines
247 B
Rust

// error-pattern: cannot copy pinned type ~~~{y: r}
resource r(i: @mutable int) {
*i = *i + 1;
}
fn main() {
let i = @mutable 0;
{
// Can't do this copy
let x = ~~~{y: r(i)};
let z = x;
}
log_err *i;
}