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

This commit is contained in:
Patrick Walton 2012-12-06 11:08:23 -08:00
parent b27150ef82
commit 45052e13a5
9 changed files with 10 additions and 36 deletions

View File

@ -2,7 +2,7 @@ fn main() {
let x = Some(~1);
match x { //~ NOTE loan of immutable local variable granted here
Some(ref _y) => {
let _a = move x; //~ ERROR moving out of immutable local variable prohibited due to outstanding loan
let _a = x; //~ ERROR moving out of immutable local variable prohibited due to outstanding loan
}
_ => {}
}

View File

@ -2,7 +2,7 @@ fn main() {
let x = Some(~1);
match x {
Some(ref y) => {
let _b = move *y; //~ ERROR moving out of dereference of immutable & pointer
let _b = *y; //~ ERROR moving out of dereference of immutable & pointer
}
_ => {}
}

View File

@ -1,10 +1,10 @@
fn take(-_v: ~int) {
fn take(_v: ~int) {
}
fn box_imm() {
let v = ~3;
let _w = &v; //~ NOTE loan of immutable local variable granted here
take(move v); //~ ERROR moving out of immutable local variable prohibited due to outstanding loan
take(v); //~ ERROR moving out of immutable local variable prohibited due to outstanding loan
}
fn main() {

View File

@ -4,7 +4,7 @@ struct Point {
}
impl Point : ops::Add<int,int> {
pure fn add(z: &int) -> int {
pure fn add(&self, z: &int) -> int {
self.x + self.y + (*z)
}
}

View File

@ -7,7 +7,7 @@ fn main() {
// Create a cycle!
match *x { //~ NOTE loan of immutable local variable granted here
node(ref y) => {
y.a = move x; //~ ERROR moving out of immutable local variable prohibited due to outstanding loan
y.a = x; //~ ERROR moving out of immutable local variable prohibited due to outstanding loan
}
empty => {}
};

View File

@ -18,5 +18,5 @@ enum wrapper = noncopyable;
fn main() {
let x1 = wrapper(noncopyable());
let _x2 = move *x1; //~ ERROR moving out of enum content
let _x2 = *x1; //~ ERROR moving out of enum content
}

View File

@ -1,6 +1,6 @@
fn foo(+x: ~int) -> int {
let y = &*x; //~ NOTE loan of argument granted here
free(move x); //~ ERROR moving out of argument prohibited due to outstanding loan
free(x); //~ ERROR moving out of argument prohibited due to outstanding loan
*y
}
@ -8,4 +8,4 @@ fn free(+_x: ~int) {
}
fn main() {
}
}

View File

@ -1,26 +0,0 @@
#[legacy_modes];
fn foo<T: Copy>(+_t: T) { fail; }
fn bar<T>(+_t: T) { fail; }
struct S {
x: int,
}
impl S : Drop {
fn finalize(&self) {}
}
fn S(x: int) -> S { S { x: x } }
impl S : Add<S, S> {
pure fn add(rhs: &S) -> S {
S { x: self.x + (*rhs).x }
}
}
fn main() {
let v = S(5);
let _y = v + (move v); //~ ERROR: copying a noncopyable value
}

View File

@ -10,7 +10,7 @@ trait parse {
impl parser: parse {
fn parse() -> ~[int] {
dvec::unwrap(move self.tokens) //~ ERROR moving out of immutable field
dvec::unwrap(self.tokens) //~ ERROR moving out of immutable field
}
}