]>
Commit | Line | Data |
---|---|---|
487cf647 FG |
1 | // compile-flags: -Zverbose |
2 | ||
3 | fn foo(_: i32, _: i32) {} | |
4 | ||
5 | fn needs_ptr(_: fn(i32, u32)) {} | |
6 | //~^ NOTE function defined here | |
7 | //~| NOTE | |
8 | ||
9 | fn main() { | |
10 | needs_ptr(foo); | |
11 | //~^ ERROR mismatched types | |
9ffffee4 | 12 | //~| NOTE expected fn pointer, found fn item |
487cf647 FG |
13 | //~| NOTE expected fn pointer `fn(i32, u32)` |
14 | //~| NOTE arguments to this function are incorrect | |
9ffffee4 | 15 | //~| NOTE when the arguments and return types match, functions can be coerced to function pointers |
487cf647 | 16 | } |