3 ms·
I don't see how Elm error messages are significantly better than those of rustc in this case. Elm says "expected Foo, found Bar" (with more flowery prose). Rust
by pcwalton 11y ago
I don't see how Elm error messages are significantly better than those of rustc in this case. Elm says "expected Foo, found Bar" (with more flowery prose). Rust says "expected Foo, found Bar".
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.
- masklinn 11y ago> 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
- pcwalton 11y agoOh, I see. That's just a straight-up compiler bug as far as I'm concerned. Doesn't have much to do with error message philosophy, really. Let's fix it :)