-
Notifications
You must be signed in to change notification settings - Fork 13.3k
"the following other types implement trait" needs improvement. #103822
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Idea: if the list of possible impls is very long, as in the The cost of this is that the user would not get the hint "typical impls of this trait look like this", which is occasionally useful, but I think it's a worthwhile tradeoff. |
Would it be possible to somehow show what types do implement it, maybe with a flag or something? When there are 500 types like the example, this info clearly isn't all that useful. But when there are only a handful of possibilities
Come on compiler, show me the options and I'll pick the one I meant! |
I know this will never happen, but it would be really awesome to be able to optionally look up the full info that the compiler has about some error messages, especially any that don't fit in the screen now $ cargo c
...
error[E0277]: the trait bound `(Pad0, Pad1, NoneT, NoneT): RxpoTxpo` is not satisfied [id: 36afd9]
$ cargo show-id 36afd9
[full message, context, help, hints, list of available traits - whatever the compiler knows] |
I wrote a macro for indexing a tuple using a constant (instead of a literal) that gives an amazing error like this when going out of bounds: New WR, btw: 812 other impls. PB attempts to follow. Update: I was able to get it up to just shy of 9k. |
I disagree, what if a user still gets the missing implementation error even though according to the documentation it looks like it should exist? Enabling to see the whole list with some optioin/flag/switch can help understand the problem (e.g. wrong version or some technicality about a generic in question). After having checked the documentation, it would still be nice to be able to confirm that the implementation does not exist or that the implementation that is supposed to be used indeed exists. |
tl;dr: this help message is pretty bad, and needs work. See some prior discussion at #102752
Let me begin with some examples:
Examples
Showing completely unrelated impls
Showing hundreds of impls
Cryptic bounds and types
Discussion
Now, lets look at what these "help" messages tend to have in common:
but these cases are fairly rare.
Discussion
Do you agree this is a problem, and what can we do about it?
The text was updated successfully, but these errors were encountered: