Type mismatch with generic parameter returns less than helpful errors #43943
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-impl-trait
Area: impl Trait. Universally / existentially quantified anonymous types with static dispatch.
A-suggestion-diagnostics
Area: suggestions generated by the compiler applied by cargo fix
A-typesystem
Area: The type system
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
WG-diagnostics
Working group: diagnostics
When a type does not match a generic parameter (I'm not sure if it's treated differently if it's because a generic constraint failed or because a previous usage dictated a particular variant of that generic), the resulting error message is not helpful because it seems to indicate that everything is OK.
As an example:
the method in question was declared as
I believe the compiler message should at least indicate the constraints on
R
, because as it currently reads,tiny_http::Response<std::io::Cursor<std::vec::Vec<u8>>>
is a valid form oftiny_http::Response<R>
forR=std::io::Cursor<std::vec::Vec<u8>>
The text was updated successfully, but these errors were encountered: