about summary refs log tree commit diff
path: root/src/test/incremental/thinlto
diff options
context:
space:
mode:
authorPietro Albini <pietro@pietroalbini.org>2018-11-18 23:24:37 +0100
committerGitHub <noreply@github.com>2018-11-18 23:24:37 +0100
commit9577734ff360235894db2904503a4d515dc89a29 (patch)
treeda0064e79d38af69284bca3e6847db2be9ad3903 /src/test/incremental/thinlto
parent71309479185827af1451dab8330a4475fe441e86 (diff)
parentf3e9b1a703203be4f375dc5fa3950b642a156ec7 (diff)
downloadrust-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).

![not_a_fn_1](https://user-images.githubusercontent.com/1076988/48309935-96755000-e538-11e8-9390-02a048abb0c2.png)

![not_a_fn_2](https://user-images.githubusercontent.com/1076988/48309936-98d7aa00-e538-11e8-8b9b-257bc77d6261.png)

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/incremental/thinlto')
0 files changed, 0 insertions, 0 deletions