Skip to content

Commit e6ab0ca

Browse files
committed
test: Fix more compile-fail bustage. rs=bustage
1 parent 216969a commit e6ab0ca

9 files changed

+8
-10
lines changed

src/test/compile-fail/borrowck-loan-rcvr-overloaded-op.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ fn b() {
2929
// Here I create an outstanding loan and check that we get conflicts:
3030

3131
let q = &mut p; //~ NOTE prior loan as mutable granted here
32-
//~^ NOTE prior loan as mutable granted here
3332

3433
p + 3; //~ ERROR loan of mutable local variable as immutable conflicts with prior loan
3534
p.times(3); //~ ERROR loan of mutable local variable as immutable conflicts with prior loan

src/test/compile-fail/copy-a-resource.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ fn foo(i:int) -> foo {
1414
}
1515
}
1616

17-
fn main() { let x = move foo(10); let y = x; log(error, x); }
17+
fn main() { let x = move foo(10); let y = copy x; log(error, x); }

src/test/compile-fail/non-copyable-void.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ fn main() {
22
let x : *~[int] = ptr::addr_of(&~[1,2,3]);
33
let y : *libc::c_void = x as *libc::c_void;
44
unsafe {
5-
let _z = *y;
5+
let _z = copy *y;
66
//~^ ERROR copying a noncopyable value
77
}
88
}

src/test/compile-fail/noncopyable-class.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ fn foo(i:int) -> foo {
2828
}
2929
}
3030

31-
fn main() { let x = move foo(10); let y = x; log(error, x); }
31+
fn main() { let x = move foo(10); let y = copy x; log(error, x); }

src/test/compile-fail/pinned-deep-copy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fn main() {
2121
{
2222
// Can't do this copy
2323
let x = ~~~{y: r(i)};
24-
let z = x;
24+
let z = copy x;
2525
log(debug, x);
2626
}
2727
log(error, *i);

src/test/compile-fail/record-with-resource.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ fn my_resource(x: int) -> my_resource {
1919
fn main() {
2020
{
2121
let a = {x: 0, y: my_resource(20)};
22-
let b = {x: 2,.. a};
22+
let b = {x: 2,.. copy a};
2323
log(error, (a, b));
2424
}
2525
}

src/test/compile-fail/unique-pinned-nocopy.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@ impl r : Drop {
1010

1111
fn main() {
1212
let i = move ~r { b: true };
13-
let j = i;
13+
let j = copy i;
1414
log(debug, i);
1515
}

src/test/compile-fail/unique-vec-res.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,14 @@ impl r : Drop {
1111
}
1212

1313
fn f<T>(+i: ~[T], +j: ~[T]) {
14-
let k = i + j;
1514
}
1615

1716
fn main() {
1817
let i1 = @mut 0;
1918
let i2 = @mut 1;
2019
let r1 = move ~[~r { i: i1 }];
2120
let r2 = move ~[~r { i: i2 }];
22-
f(r1, r2);
21+
f(copy r1, copy r2);
2322
log(debug, (r2, *i1));
2423
log(debug, (r1, *i2));
2524
}

src/test/compile-fail/vec-res-add.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// error-pattern: copying a noncopyable value
1+
// error-pattern: instantiating a type parameter with an incompatible type
22

33
struct r {
44
i:int

0 commit comments

Comments
 (0)