139749934b
Improve diagnostics for function passed when a type was expected. This PR improves diagnostics, it provides more information when a function is passed where a type is expected. r? `@lcnr`
For high-level intro to how type checking works in rustc, see the type checking chapter of the rustc dev guide.