b8bb663df7
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.
15 lines
230 B
Rust
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;
|
|
} |