rust/src/test/compile-fail/pinned-deep-copy.rs
2012-03-26 18:35:18 -07:00

16 lines
260 B
Rust

// error-pattern: copying a noncopyable value
resource r(i: @mut int) {
*i = *i + 1;
}
fn main() {
let i = @mut 0;
{
// Can't do this copy
let x = ~~~{y: r(i)};
let z = x;
log(debug, x);
}
log(error, *i);
}