Re:Experimenting with Rust generics and dynamic traits
by masklinn on Tuesday March 29, 2016 @01:14PM
(#11383008)
> I do think that this error could be improved by suggesting #[derive(Debug)], don't get me wrong.
That's what it's already doing:
> src/x/mod.rs:22:33: 22:34 note: `T` cannot be formatted using `:?`; if it is defined in your crate, add `#[derive(Debug)]` or manually implement it
and it's wrong, the error is a missing trait bound not a missing interface implementation
The examples on that page are all extremely simple type errors in the first place, whereas this error message relates to a much more advanced feature (typeclasses/traits). I'd like to see what the ideal trait mismatch error would look like.
I do think that this error could be improved by suggesting #[derive(Debug)], don't get me wrong. But I don't know of any compiler for any language that goes out of its way to explain how to implement an interface on every interface-not-implemented error.