about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/errors.rs
diff options
context:
space:
mode:
authorRobin Schroer <git@sulami.xyz>2023-01-08 21:10:48 +0900
committerRobin Schroer <git@sulami.xyz>2023-01-13 13:34:55 +0900
commita3cf3822d267524e3d9fa45309f2718793f3cf7f (patch)
tree400f87368a38ea4a2f1acdff0eedd27b719cbec3 /compiler/rustc_parse/src/errors.rs
parent56ee65aeb6d1fad67d903d5ee1359abcf7b94231 (diff)
downloadrust-a3cf3822d267524e3d9fa45309f2718793f3cf7f.tar.gz
rust-a3cf3822d267524e3d9fa45309f2718793f3cf7f.zip
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