提交 cf753a2d 编写于 作者: N Niko Matsakis

Correct tests that were supposed to fail but now pass due to the fn trait hierarchy.

上级 ff361530
......@@ -12,6 +12,6 @@
fn main() {
let mut_ = |&mut: x| x;
mut_.call_once((0i, )); //~ ERROR type `closure` does not implement
mut_.call((0i, )); //~ ERROR type `closure` does not implement
}
......@@ -18,7 +18,7 @@ fn call_it<F:FnMut<(int,int),int>>(y: int, mut f: F) -> int {
pub fn main() {
let f = |&mut: x: uint, y: int| -> int { (x as int) + y };
let z = call_it(3, f); //~ ERROR type mismatch
let z = call_it(3, f); //~ ERROR not implemented
println!("{}", z);
}
......@@ -10,13 +10,13 @@
#![feature(lang_items, overloaded_calls, unboxed_closures)]
fn c<F:FnOnce(int, int) -> int>(f: F) -> int {
fn c<F:Fn(int, int) -> int>(f: F) -> int {
f(5, 6)
}
fn main() {
let z: int = 7;
assert_eq!(c(|&: x: int, y| x + y + z), 10);
assert_eq!(c(|&mut: x: int, y| x + y + z), 10);
//~^ ERROR not implemented
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册