| 22:34 error: the trait `core::fmt::Debug` is not implemented for the type `T` [E0277] 22 println!("trait: {:?}", i); This error message is fantastic! On line 22, i is of type T which does not implement Debug. The hint is off, but the actual error is super useful. Turns out if you google "Rust e0277" which is the error code he got, this is the top result: https://users.rust-lang.org/t/generics-or-how-do-i-solve-an-... Which contains the same solution to his problem. TL;DR Nothing to see here, just a case of "let me google that for you" |
> The hint is off, but the actual error is super useful.
I completely disagree. The actual error is very basic and only useful if you already know what it pertains to, that the hint be way off is actively harmful.
> TL;DR Nothing to see here, just a case of "let me google that for you"
No, it's a case of the compiler not helping and just dumping the raw error in your lap, let's not settle for being GCC when we can do better: http://elm-lang.org/blog/compilers-as-assistants
You shouldn't need to google a bloody traits bound error (and may not even be able to, because you're trying Rust on a bus during your commute and have run out of data) (note that the rustc --explain output doesn't quite help either, it also assumes you already understand trait bounds and also suggests implementing the relevant trait on your type, which is the other way around from the issue, a careful read of the code snippets may hint at the solution, but the explanation doesn't point to it)