Rust logo
Rust 1.16.0

Rustc UX guidelines

Don't forget the user. Whether human or another program, such as an IDE, a good user experience with the compiler goes a long way into making developer lives better. We don't want users to be baffled by compiler output or learn arcane patterns to compile their program.

0.1 Error, Warning, Help, Note Messages

When the compiler detects a problem, it can emit either an error, warning, note, or help message.

An error is emitted when the compiler detects a problem that makes it unable to compile the program, either because the program is invalid or the programmer has decided to make a specific warning into an error.

A warning is emitted when the compiler detects something odd about a program. For instance, dead code and unused Result values.

A help is emitted following either an error or warning giving extra information to the user about how to solve their problem.

A note is for identifying additional circumstances and parts of the code that lead to a warning or error. For example, the borrow checker will note any previous conflicting borrows.

0.2 Error Explanations

Error explanations are long form descriptions of error messages provided with the compiler. They are accessible via the --explain flag. Each explanation comes with an example of how to trigger it and advice on how to fix it.

0.3 Compiler Flags