You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For any highly generic library (futures is the one that I hit this issue with a lot) it's easy for types to become unreadable very fast. Even impl Trait only helps so much (we're using Box<Trait> a lot in our code so impl Trait won't get us better error messages). A good solution would be to rustfmt-style pretty-print types in the error messages so that it's possible for humans to parse them. It might be useful to make this optional or otherwise limit the maximum size because I can imagine this causing diesel's types to take hundreds of lines to print. Probably some kind of overrideable heuristic would be useful to implement here.
The text was updated successfully, but these errors were encountered:
This would be very nice. One of the things that I really liked about rust initially was the high quality error messages. I feel like with a lot of these combinator based libraries, the error messages get pretty terrible. I don't think we're at C++ template level yet, but it definitely reminds me of them.
I also think it might be useful to also optionally leave out irrelevant stuff or provide a short summary at the top that is easy to parse for a human in cases in which just pretty-printing things isn't enough.
For any highly generic library (
futures
is the one that I hit this issue with a lot) it's easy for types to become unreadable very fast. Evenimpl Trait
only helps so much (we're usingBox<Trait>
a lot in our code soimpl Trait
won't get us better error messages). A good solution would be torustfmt
-style pretty-print types in the error messages so that it's possible for humans to parse them. It might be useful to make this optional or otherwise limit the maximum size because I can imagine this causingdiesel
's types to take hundreds of lines to print. Probably some kind of overrideable heuristic would be useful to implement here.The text was updated successfully, but these errors were encountered: