Correct tests that were supposed to fail but now pass due to the fn trait hierarchy.
This commit is contained in:
parent
ff361530b5
commit
cf753a2dc7
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user