1
Fork 0

Add two xfailed tests for invalid copies into vectors

This commit is contained in:
Brian Anderson 2011-09-26 23:45:51 -07:00
parent 1796abc3ef
commit b49f4689f5
2 changed files with 36 additions and 0 deletions

View file

@ -0,0 +1,18 @@
// xfail-test
// error-pattern:mismatched kind
resource r(i: @mutable int) {
*i = *i + 1;
}
fn main() {
let a = @mutable 0;
{
let i <- r(a);
// Can't copy into here
let j <- [i];
}
log_err *a;
// this is no good
assert *a == 2;
}

View file

@ -0,0 +1,18 @@
// xfail-test
// error-pattern:mismatched kind
resource r(i: @mutable int) {
*i = *i + 1;
}
fn main() {
let a = @mutable 0;
{
let i <- ~r(a);
// Can't copy into here
let j <- [i];
}
log_err *a;
// this is no good
assert *a == 2;
}