Closed
Description
The code used to work, but now it doesn't compile:
fn double(x: int) -> int {
x * 2
}
fn main() {
let v = (~[1, 2, 3]).map(double);
}
Rustc says:
test-extern-fn.rs:9:29: 9:35 error: mismatched types: expected `&fn(+:&<VI2>) -> <V8>` but found `extern fn(int) -> int` (expected &-ptr but found int)
test-extern-fn.rs:9 let v = (~[1, 2, 3]).map(double);
^~~~~~
test-extern-fn.rs:9:8: 9:36 error: cannot determine a type for this local variable: unconstrained type
test-extern-fn.rs:9 let v = (~[1, 2, 3]).map(double);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 2 previous errors
This may be intentional but also might be a bug.
Metadata
Metadata
Assignees
Labels
No labels