Skip to content

Commit b07a78b

Browse files
committed
Fix broken tests
1 parent 9677fff commit b07a78b

File tree

5 files changed

+7
-89
lines changed

5 files changed

+7
-89
lines changed

src/test/compile-fail/block-arg-used-as-lambda-with-illegal-cap.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ fn to_lambda1(f: fn@(uint) -> uint) -> fn@(uint) -> uint {
1313
}
1414

1515
fn to_lambda2(b: fn(uint) -> uint) -> fn@(uint) -> uint {
16-
return to_lambda1({|x| b(x)}); //~ ERROR value may contain borrowed pointers
16+
return to_lambda1({|x| b(x)}); //~ ERROR illegal move from argument `b`
1717
}
1818

1919
fn main() {

src/test/compile-fail/copy-into-closure.rs

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,42 +8,23 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
fn closure1(+x: ~str) -> (~str, fn@() -> ~str) {
12-
let f = fn@() -> ~str {
13-
copy x
14-
//~^ WARNING implicitly copying a non-implicitly-copyable value
15-
//~^^ NOTE to copy values into a @fn closure, use a capture clause
16-
};
17-
(move x,f)
18-
}
19-
2011
fn closure2(+x: util::NonCopyable) -> (util::NonCopyable,
2112
fn@() -> util::NonCopyable) {
22-
let f = fn@() -> util::NonCopyable {
23-
copy x
13+
let f = fn@(copy x) -> util::NonCopyable {
2414
//~^ ERROR copying a noncopyable value
2515
//~^^ NOTE non-copyable value cannot be copied into a @fn closure
26-
//~^^^ ERROR copying a noncopyable value
16+
copy x
17+
//~^ ERROR copying a noncopyable value
2718
};
2819
(move x,f)
2920
}
3021
fn closure3(+x: util::NonCopyable) {
31-
do task::spawn {
32-
let s = copy x;
22+
do task::spawn |copy x| {
3323
//~^ ERROR copying a noncopyable value
3424
//~^^ NOTE non-copyable value cannot be copied into a ~fn closure
35-
//~^^^ ERROR copying a noncopyable value
36-
error!("%?", s);
25+
error!("%?", x);
3726
}
3827
error!("%?", x);
3928
}
4029
fn main() {
41-
let x = ~"hello";
42-
do task::spawn {
43-
let s = copy x;
44-
//~^ WARNING implicitly copying a non-implicitly-copyable value
45-
//~^^ NOTE to copy values into a ~fn closure, use a capture clause
46-
error!("%s from child", s);
47-
}
48-
error!("%s", x);
4930
}

src/test/compile-fail/issue-2487-b.rs

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

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

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

src/test/compile-fail/no-capture-arc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// error-pattern: copying a noncopyable value
11+
// error-pattern: use of moved variable
1212

1313
extern mod std;
1414
use std::arc;

0 commit comments

Comments
 (0)