Skip to content

Commit 45052e1

Browse files
committed
test: Fix some compile-fail bustage. rs=bustage
1 parent b27150e commit 45052e1

9 files changed

+10
-36
lines changed

src/test/compile-fail/borrowck-issue-2657-1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ fn main() {
22
let x = Some(~1);
33
match x { //~ NOTE loan of immutable local variable granted here
44
Some(ref _y) => {
5-
let _a = move x; //~ ERROR moving out of immutable local variable prohibited due to outstanding loan
5+
let _a = x; //~ ERROR moving out of immutable local variable prohibited due to outstanding loan
66
}
77
_ => {}
88
}

src/test/compile-fail/borrowck-issue-2657-2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ fn main() {
22
let x = Some(~1);
33
match x {
44
Some(ref y) => {
5-
let _b = move *y; //~ ERROR moving out of dereference of immutable & pointer
5+
let _b = *y; //~ ERROR moving out of dereference of immutable & pointer
66
}
77
_ => {}
88
}

src/test/compile-fail/borrowck-loan-blocks-move.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
fn take(-_v: ~int) {
1+
fn take(_v: ~int) {
22
}
33

44
fn box_imm() {
55
let v = ~3;
66
let _w = &v; //~ NOTE loan of immutable local variable granted here
7-
take(move v); //~ ERROR moving out of immutable local variable prohibited due to outstanding loan
7+
take(v); //~ ERROR moving out of immutable local variable prohibited due to outstanding loan
88
}
99

1010
fn main() {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ struct Point {
44
}
55

66
impl Point : ops::Add<int,int> {
7-
pure fn add(z: &int) -> int {
7+
pure fn add(&self, z: &int) -> int {
88
self.x + self.y + (*z)
99
}
1010
}

src/test/compile-fail/borrowck-no-cycle-in-exchange-heap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ fn main() {
77
// Create a cycle!
88
match *x { //~ NOTE loan of immutable local variable granted here
99
node(ref y) => {
10-
y.a = move x; //~ ERROR moving out of immutable local variable prohibited due to outstanding loan
10+
y.a = x; //~ ERROR moving out of immutable local variable prohibited due to outstanding loan
1111
}
1212
empty => {}
1313
};

src/test/compile-fail/borrowck-unary-move-2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ enum wrapper = noncopyable;
1818

1919
fn main() {
2020
let x1 = wrapper(noncopyable());
21-
let _x2 = move *x1; //~ ERROR moving out of enum content
21+
let _x2 = *x1; //~ ERROR moving out of enum content
2222
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
fn foo(+x: ~int) -> int {
22
let y = &*x; //~ NOTE loan of argument granted here
3-
free(move x); //~ ERROR moving out of argument prohibited due to outstanding loan
3+
free(x); //~ ERROR moving out of argument prohibited due to outstanding loan
44
*y
55
}
66

77
fn free(+_x: ~int) {
88
}
99

1010
fn main() {
11-
}
11+
}

src/test/compile-fail/issue-2587-2.rs

Lines changed: 0 additions & 26 deletions
This file was deleted.

src/test/compile-fail/issue-2590.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ trait parse {
1010

1111
impl parser: parse {
1212
fn parse() -> ~[int] {
13-
dvec::unwrap(move self.tokens) //~ ERROR moving out of immutable field
13+
dvec::unwrap(self.tokens) //~ ERROR moving out of immutable field
1414
}
1515
}
1616

0 commit comments

Comments
 (0)