Closed
Description
A minimal test case. My actual case is much more complex, involves functions/callbacks with multiple params and several layers of typedefs.
fn takes_cb(f: fn(i8)) {}
fn main() {
fn callback(x: i32) {}
takes_cb(callback)
}
The error reported on 1.11.0 is this:
test.rs:5:14: 5:22 error: mismatched types [E0308]
test.rs:5 takes_cb(callback)
^~~~~~~~
test.rs:5:14: 5:22 help: run `rustc --explain E0308` to see a detailed explanation
test.rs:5:14: 5:22 note: expected type `fn(i8)`
test.rs:5:14: 5:22 note: found type `fn(i32) {main::callback}`
Useful and obvious. What error looks like now (stable (1.14.0)/beta/nightly (1.16.0))?
error[E0308]: mismatched types
--> test.rs:5:14
|
5 | takes_cb(callback)
| ^^^^^^^^ expected i8, found i32
Cute but is as worthless and confusing as it gets.