1
Fork 0

test: Fix busted compile-fail tests. rs=bustage

This commit is contained in:
Patrick Walton 2013-01-17 16:30:59 -08:00
parent f405e41d7a
commit 9f7514bfae
8 changed files with 15 additions and 18 deletions

View file

@ -55,9 +55,8 @@ fn c() {
*q + 3;
// ...but not impure fns
(*q).times(3); //~ ERROR illegal borrow unless pure
//~^ NOTE impure due to access to impure function
// ...and impure fns
(*q).times(3);
}
fn main() {

View file

@ -62,9 +62,8 @@ fn c() {
// ...this is ok for pure fns
(*q).purem();
// ...but not impure fns
(*q).impurem(); //~ ERROR illegal borrow unless pure
//~^ NOTE impure due to access to impure function
// ...and impure fns
(*q).impurem();
}
fn main() {

View file

@ -19,9 +19,9 @@ fn main() {
loop {
// tjc: Not sure why it prints the same error twice
x = move y; //~ ERROR use of moved value
//~^ NOTE move of value occurred here
//~^ NOTE move of variable occurred here
//~^^ ERROR use of moved value
//~^^^ NOTE move of value occurred here
//~^^^ NOTE move of variable occurred here
copy x;
}

View file

@ -17,8 +17,8 @@ fn main() {
// tjc: not sure why it prints the same error twice
while true { while true { while true { x = move y; copy x; } } }
//~^ ERROR use of moved value: `y`
//~^^ NOTE move of value occurred here
//~^^ NOTE move of variable occurred here
//~^^^ ERROR use of moved value: `y`
//~^^^^ NOTE move of value occurred here
//~^^^^ NOTE move of variable occurred here
}
}

View file

@ -10,7 +10,7 @@
fn main() {
let x = @5;
let y = move x; //~ NOTE move of value occurred here
let y = move x; //~ NOTE move of variable occurred here
log(debug, *x); //~ ERROR use of moved value: `x`
copy y;
}

View file

@ -19,7 +19,7 @@ enum _chan<T> = int;
// Tests that "log(debug, message);" is flagged as using
// message after the send deinitializes it
fn test00_start(ch: _chan<int>, message: int, _count: int) {
send(ch, move message); //~ NOTE move of value occurred here
send(ch, move message); //~ NOTE move of variable occurred here
log(debug, message); //~ ERROR use of moved value: `message`
}

View file

@ -16,7 +16,7 @@ fn main() {
let v = ~[1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
let arc_v = arc::ARC(v);
do task::spawn() |move arc_v| { //~ NOTE move of value occurred here
do task::spawn() |move arc_v| { //~ NOTE move of variable occurred here
let v = *arc::get(&arc_v);
assert v[3] == 4;
};

View file

@ -9,15 +9,14 @@
// except according to those terms.
// The type of `y` ends up getting inferred to the type of the block.
fn broken() -> int {
fn broken() {
let mut x = 3;
let mut y = ~[&mut x];
let mut _y = ~[&mut x];
while x < 10 {
let mut z = x;
y += ~[&mut z]; //~ ERROR illegal borrow
_y.push(&mut z); //~ ERROR illegal borrow
x += 1;
}
vec::foldl(0, y, |v, p| v + **p )
}
fn main() { }
fn main() { }