Skip to content

Commit b49f468

Browse files
committed
Add two xfailed tests for invalid copies into vectors
1 parent 1796abc commit b49f468

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// xfail-test
2+
// error-pattern:mismatched kind
3+
4+
resource r(i: @mutable int) {
5+
*i = *i + 1;
6+
}
7+
8+
fn main() {
9+
let a = @mutable 0;
10+
{
11+
let i <- r(a);
12+
// Can't copy into here
13+
let j <- [i];
14+
}
15+
log_err *a;
16+
// this is no good
17+
assert *a == 2;
18+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// xfail-test
2+
// error-pattern:mismatched kind
3+
4+
resource r(i: @mutable int) {
5+
*i = *i + 1;
6+
}
7+
8+
fn main() {
9+
let a = @mutable 0;
10+
{
11+
let i <- ~r(a);
12+
// Can't copy into here
13+
let j <- [i];
14+
}
15+
log_err *a;
16+
// this is no good
17+
assert *a == 2;
18+
}

0 commit comments

Comments
 (0)