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

This commit is contained in:
Niko Matsakis 2014-11-03 14:48:17 -05:00
parent ff361530b5
commit cf753a2dc7
3 changed files with 4 additions and 4 deletions

View File

@ -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
}

View File

@ -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);
}

View File

@ -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
}