Commit graph

104 commits

Author SHA1 Message Date
Esteban Küber 33e11a3b2e Tweak "borrow closure argument" suggestion
Fix #45727.
2023-01-19 19:35:49 +00:00
Esteban Küber 656db98bd9 Tweak E0597
CC #99430
2023-01-15 19:46:20 +00:00
Robin Schroer a3cf3822d2
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.
2023-01-13 13:34:55 +09:00
Albert Larsan cf2dff2b1e
Move /src/test to /tests 2023-01-11 09:32:08 +00:00