Add two xfailed tests for invalid copies into vectors
This commit is contained in:
parent
1796abc3ef
commit
b49f4689f5
2 changed files with 36 additions and 0 deletions
18
src/test/compile-fail/resource-vec-copy.rs
Normal file
18
src/test/compile-fail/resource-vec-copy.rs
Normal 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;
|
||||
}
|
18
src/test/compile-fail/unique-pinned-nocopy-3.rs
Normal file
18
src/test/compile-fail/unique-pinned-nocopy-3.rs
Normal 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;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue