Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upType mismatch with generic parameter returns less than helpful errors #43943
Comments
Mark-Simulacrum
added
A-diagnostics
C-enhancement
labels
Aug 20, 2017
estebank
added
the
WG-compiler-errors
label
Dec 9, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
mqudsi commentedAug 17, 2017
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>>