fix tests
This commit is contained in:
parent
ec11f66dbf
commit
a55011e788
2 changed files with 3 additions and 3 deletions
|
@ -14,6 +14,6 @@ use std::ops::FnMut;
|
|||
|
||||
pub fn main() {
|
||||
let mut f = |&mut: x: int, y: int| -> int { x + y };
|
||||
let z = f(1u, 2); //~ ERROR type mismatch
|
||||
let z = f(1u, 2); //~ ERROR mismatched types
|
||||
println!("{}", z);
|
||||
}
|
||||
|
|
|
@ -11,11 +11,11 @@
|
|||
// Tests calls to closure arguments where the closure takes 0 arguments.
|
||||
// This is a bit tricky due to rust-call ABI.
|
||||
|
||||
fn foo(f: &mut FnMut()) -> int {
|
||||
fn foo(f: &mut FnMut() -> int) -> int {
|
||||
f()
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let z = foo(|| 22);
|
||||
let z = foo(&mut || 22);
|
||||
assert_eq!(z, 22);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue