diff options
| author | xFrednet <xFrednet@gmail.com> | 2021-10-28 18:30:49 +0200 |
|---|---|---|
| committer | Joshua Nelson <github@jyn.dev> | 2021-10-29 21:51:05 -0500 |
| commit | 9160d76d5362ff246dd45a57f368b78c97f6f0f9 (patch) | |
| tree | 25e0ccb24fe318b895767a8e66fe405f6730a5c1 /src/doc | |
| parent | 52a1d9b4f6f6d6e4b7110335d153cf0785abf115 (diff) | |
| download | rust-9160d76d5362ff246dd45a57f368b78c97f6f0f9.tar.gz rust-9160d76d5362ff246dd45a57f368b78c97f6f0f9.zip | |
Some minor adjustments to the diagnostic documentation
Diffstat (limited to 'src/doc')
| -rw-r--r-- | src/doc/rustc-dev-guide/src/diagnostics.md | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/doc/rustc-dev-guide/src/diagnostics.md b/src/doc/rustc-dev-guide/src/diagnostics.md index e35bde093a9..20dbefd7b06 100644 --- a/src/doc/rustc-dev-guide/src/diagnostics.md +++ b/src/doc/rustc-dev-guide/src/diagnostics.md @@ -26,10 +26,12 @@ LL | more code | ^^^^ ``` -- Description (`error`, `warning`, etc.). +- Level (`error`, `warning`, etc.). It indicates the severity of the message. + (See [diagnostic levels](#diagnostic-levels)) - Code (for example, for "mismatched types", it is `E0308`). It helps users get more information about the current error through an extended - description of the problem in the error code index. + description of the problem in the error code index. Diagnostics created + by lints don't have a code in the emitted message. - Message. It is the main description of the problem. It should be general and able to stand on its own, so that it can make sense even in isolation. - Diagnostic window. This contains several things: @@ -61,7 +63,11 @@ error: the fobrulator needs to be krontrificated ``` When code or an identifier must appear in a message or label, it should be -surrounded with backticks: `` `foo.bar` ``. +surrounded with backticks: + +```txt +error: the identifier `foo.bar` is invalid +``` ### Error explanations |
