test: Fix more compile-fail bustage. rs=bustage

This commit is contained in:
Patrick Walton 2012-12-06 12:12:55 -08:00
parent 216969ae08
commit e6ab0ca8b1
9 changed files with 8 additions and 10 deletions

View File

@ -29,7 +29,6 @@ fn b() {
// Here I create an outstanding loan and check that we get conflicts:
let q = &mut p; //~ NOTE prior loan as mutable granted here
//~^ NOTE prior loan as mutable granted here
p + 3; //~ ERROR loan of mutable local variable as immutable conflicts with prior loan
p.times(3); //~ ERROR loan of mutable local variable as immutable conflicts with prior loan

View File

@ -14,4 +14,4 @@ fn foo(i:int) -> foo {
}
}
fn main() { let x = move foo(10); let y = x; log(error, x); }
fn main() { let x = move foo(10); let y = copy x; log(error, x); }

View File

@ -2,7 +2,7 @@ fn main() {
let x : *~[int] = ptr::addr_of(&~[1,2,3]);
let y : *libc::c_void = x as *libc::c_void;
unsafe {
let _z = *y;
let _z = copy *y;
//~^ ERROR copying a noncopyable value
}
}

View File

@ -28,4 +28,4 @@ fn foo(i:int) -> foo {
}
}
fn main() { let x = move foo(10); let y = x; log(error, x); }
fn main() { let x = move foo(10); let y = copy x; log(error, x); }

View File

@ -21,7 +21,7 @@ fn main() {
{
// Can't do this copy
let x = ~~~{y: r(i)};
let z = x;
let z = copy x;
log(debug, x);
}
log(error, *i);

View File

@ -19,7 +19,7 @@ fn my_resource(x: int) -> my_resource {
fn main() {
{
let a = {x: 0, y: my_resource(20)};
let b = {x: 2,.. a};
let b = {x: 2,.. copy a};
log(error, (a, b));
}
}

View File

@ -10,6 +10,6 @@ impl r : Drop {
fn main() {
let i = move ~r { b: true };
let j = i;
let j = copy i;
log(debug, i);
}

View File

@ -11,7 +11,6 @@ impl r : Drop {
}
fn f<T>(+i: ~[T], +j: ~[T]) {
let k = i + j;
}
fn main() {
@ -19,7 +18,7 @@ fn main() {
let i2 = @mut 1;
let r1 = move ~[~r { i: i1 }];
let r2 = move ~[~r { i: i2 }];
f(r1, r2);
f(copy r1, copy r2);
log(debug, (r2, *i1));
log(debug, (r1, *i2));
}

View File

@ -1,4 +1,4 @@
// error-pattern: copying a noncopyable value
// error-pattern: instantiating a type parameter with an incompatible type
struct r {
i:int