mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
test: Fix more compile-fail bustage. rs=bustage
This commit is contained in:
parent
216969ae08
commit
e6ab0ca8b1
@ -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
|
||||
|
@ -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); }
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
|
@ -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); }
|
||||
|
@ -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);
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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));
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
// error-pattern: copying a noncopyable value
|
||||
// error-pattern: instantiating a type parameter with an incompatible type
|
||||
|
||||
struct r {
|
||||
i:int
|
||||
|
Loading…
Reference in New Issue
Block a user