f3e9b1a703
Now the main span focuses on the erroneous not-a-function callee, while showing the entire call expression is relegated to a secondary span. In the case where the erroneous callee is itself a call, we point out the definition, and, if the call expression spans multiple lines, tentatively suggest a semicolon (because we suspect that the "outer" call is actually supposed to be a tuple). The new `bug!` assertion is, in fact, safe (`confirm_builtin_call` is only called by `check_call`, which is only called with a first arg of kind `ExprKind::Call` in `check_expr_kind`). Resolves #51055.
25 lines
618 B
Plaintext
25 lines
618 B
Plaintext
error[E0618]: expected function, found `U`
|
|
--> $DIR/issue-21701.rs:12:13
|
|
|
|
|
LL | fn foo<U>(t: U) {
|
|
| - `U` defined here
|
|
LL | let y = t();
|
|
| ^--
|
|
| |
|
|
| call expression requires function
|
|
|
|
error[E0618]: expected function, found `Bar`
|
|
--> $DIR/issue-21701.rs:19:13
|
|
|
|
|
LL | struct Bar;
|
|
| ----------- `Bar` defined here
|
|
...
|
|
LL | let f = Bar();
|
|
| ^^^--
|
|
| |
|
|
| call expression requires function
|
|
|
|
error: aborting due to 2 previous errors
|
|
|
|
For more information about this error, try `rustc --explain E0618`.
|