Skip to content

Commit cf753a2

Browse files
committed
Correct tests that were supposed to fail but now pass due to the fn trait hierarchy.
1 parent ff36153 commit cf753a2

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

src/test/compile-fail/unboxed-closures-static-call-wrong-trait.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212

1313
fn main() {
1414
let mut_ = |&mut: x| x;
15-
mut_.call_once((0i, )); //~ ERROR type `closure` does not implement
15+
mut_.call((0i, )); //~ ERROR type `closure` does not implement
1616
}
1717

src/test/compile-fail/unboxed-closures-vtable-mismatch.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ fn call_it<F:FnMut<(int,int),int>>(y: int, mut f: F) -> int {
1818

1919
pub fn main() {
2020
let f = |&mut: x: uint, y: int| -> int { (x as int) + y };
21-
let z = call_it(3, f); //~ ERROR type mismatch
21+
let z = call_it(3, f); //~ ERROR not implemented
2222
println!("{}", z);
2323
}
2424

src/test/compile-fail/unboxed-closures-wrong-trait.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@
1010

1111
#![feature(lang_items, overloaded_calls, unboxed_closures)]
1212

13-
fn c<F:FnOnce(int, int) -> int>(f: F) -> int {
13+
fn c<F:Fn(int, int) -> int>(f: F) -> int {
1414
f(5, 6)
1515
}
1616

1717
fn main() {
1818
let z: int = 7;
19-
assert_eq!(c(|&: x: int, y| x + y + z), 10);
19+
assert_eq!(c(|&mut: x: int, y| x + y + z), 10);
2020
//~^ ERROR not implemented
2121
}
2222

0 commit comments

Comments
 (0)