Update some more tests for 1a68a9882

This commit is contained in:
Marijn Haverbeke 2011-11-03 11:14:48 +01:00
parent 4ce6472c02
commit 5945667b99
3 changed files with 1 additions and 43 deletions

View file

@ -1,21 +0,0 @@
// error-pattern: cannot copy pinned type r
resource r(i: @mutable int) {
*i = *i + 1;
}
fn movearg(i: r) {
// Implicit copy to mutate reference i
let j <- i;
}
fn main() {
let i = @mutable 0;
{
let j <- r(i);
movearg(j);
}
log_err *i;
// nooooooo. destructor ran twice
assert *i == 2;
}

View file

@ -1,21 +0,0 @@
// error-pattern: cannot copy pinned type 'a
resource r(i: @mutable int) {
*i = *i + 1;
}
fn movearg<pin T>(i: T) {
// Implicit copy to mutate reference i
let j <- i;
}
fn main() {
let i = @mutable 0;
{
let j <- r(i);
movearg(j);
}
log_err *i;
// nooooooo. destructor ran twice
assert *i == 2;
}

View file

@ -1,5 +1,5 @@
// error-pattern:quux
fn test00_start(ch: chan_t<int>, message: int) { send(ch, message); }
fn test00_start(ch: chan_t<int>, message: int) { send(ch, copy message); }
type task_id = int;
type port_id = int;