about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/errors.rs
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-01-14 13:04:26 +0100
committerGitHub <noreply@github.com>2023-01-14 13:04:26 +0100
commit108b5f462b0c1845253002c3d4b615a11a844cb8 (patch)
tree81ac3c88a811ee2e04f2639087a7590d75b7cdf8 /compiler/rustc_parse/src/errors.rs
parent3fa9be9094e5412afeea05ce5ed821700809d0d2 (diff)
parenta3cf3822d267524e3d9fa45309f2718793f3cf7f (diff)
downloadrust-108b5f462b0c1845253002c3d4b615a11a844cb8.tar.gz
rust-108b5f462b0c1845253002c3d4b615a11a844cb8.zip
Rollup merge of #106752 - sulami:master, r=estebank
Emit a hint for bad call return types due to generic arguments

When the return type of a function call depends on the type of an argument, e.g.

```
fn foo<T>(x: T) -> T {
    x
}
```

and the expected type is set due to either an explicitly typed binding, or because the call to the function is in a tail position without semicolon, the current error implies that the argument in the call has the wrong type.

This new hint highlights that the expected type doesn't match the returned type, which matches the argument type, and that that's why we're flagging the argument type.

Fixes #43608.
Diffstat (limited to 'compiler/rustc_parse/src/errors.rs')
0 files changed, 0 insertions, 0 deletions