mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
108b5f462b
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. |
||
---|---|---|
.. | ||
ufcs-explicit-self-bad.rs | ||
ufcs-explicit-self-bad.stderr | ||
ufcs-partially-resolved.rs | ||
ufcs-partially-resolved.stderr | ||
ufcs-qpath-missing-params.rs | ||
ufcs-qpath-missing-params.stderr | ||
ufcs-qpath-self-mismatch.rs | ||
ufcs-qpath-self-mismatch.stderr |