rust/src/test/compile-fail/pinned-deep-copy.rs
Brian Anderson b8bb663df7 Don't ever raise unique kinds of pinned kinds to shared (again)
So *resource, ~resource, [resource] are all pinned. This is counter to the
design of the kind system, but this way is a much clearer path to type safety.
Once we've established a good baseline with lots of tests, then we can try to
make raising pinned kinds work.
2011-09-27 16:03:10 -07:00

15 lines
230 B
Rust

// error-pattern: mismatched kinds
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;
}