diff options
| author | Pietro Albini <pietro@pietroalbini.org> | 2018-11-18 23:24:37 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-11-18 23:24:37 +0100 |
| commit | 9577734ff360235894db2904503a4d515dc89a29 (patch) | |
| tree | da0064e79d38af69284bca3e6847db2be9ad3903 /src/test/ui/error-codes | |
| parent | 71309479185827af1451dab8330a4475fe441e86 (diff) | |
| parent | f3e9b1a703203be4f375dc5fa3950b642a156ec7 (diff) | |
| download | rust-9577734ff360235894db2904503a4d515dc89a29.tar.gz rust-9577734ff360235894db2904503a4d515dc89a29.zip | |
Rollup merge of #55862 - zackmdavis:but_will_they_come_when_you_call_them, r=estebank
in which the E0618 "expected function" diagnostic gets a makeover A woman of wisdom once told me, "Better late than never." (Can't reopen the previously-closed pull request from six months ago [due to GitHub limitations](https://github.com/rust-lang/rust/pull/51098#issuecomment-437647157).) 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. r? @estebank
Diffstat (limited to 'src/test/ui/error-codes')
| -rw-r--r-- | src/test/ui/error-codes/E0618.stderr | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/test/ui/error-codes/E0618.stderr b/src/test/ui/error-codes/E0618.stderr index ef7ace44d59..3bcc83e01c1 100644 --- a/src/test/ui/error-codes/E0618.stderr +++ b/src/test/ui/error-codes/E0618.stderr @@ -5,7 +5,9 @@ LL | Entry, | ----- `X::Entry` defined here ... LL | X::Entry(); - | ^^^^^^^^^^ not a function + | ^^^^^^^^-- + | | + | call expression requires function help: `X::Entry` is a unit variant, you need to write it without the parenthesis | LL | X::Entry; @@ -17,7 +19,9 @@ error[E0618]: expected function, found `i32` LL | let x = 0i32; | - `i32` defined here LL | x(); - | ^^^ not a function + | ^-- + | | + | call expression requires function error: aborting due to 2 previous errors |
