Stage 1.13: Compiler Messages
Compiler messages in Rust are really helpful and informative in most cases. The Rust team and the contributors are constantly improving the messages.
Compiler messages consists of 4 parts:
- A short error message, sometimes with an error code, e. g.
error[E0277]: `Foo` doesn't implement `Debug`
- The code part, which is colorful and with underlines
- An optional help block which provides solutions, which you can sometimes just copy & paste
- An optional further information message, e. g.
For more information about this error, try `rustc --explain E0277`
Run the code from the Rust Playground and read the Standard Error block.
You can actually copy & paste the provided help to get your program working as expected.
After it, your programm will look like this.
Further information: