Expand description
The error index: every code the compiler can emit, in one place.
crate::Diagnostic::code promised “a stable code (B0101) so that tests, docs and the
eventual error index agree”. This is that index, and the agreement is a test rather than an
intention: beck-cli/tests/docs.rs scans every non-test source file in the workspace for a
"Bnnnn" literal and fails if the set it finds differs from INDEX in either direction. A
code cannot be added without an entry, and an entry cannot outlive its code.
§What an entry says, and where it comes from
Every diagnostic site in the compiler already carries a label, usually a note and often a
fix-it — prose the project wrote next to the condition that raises it.
CodeEntry::explain is that prose, condensed. Nothing here is a second, independent account
of what the compiler does, because a second account is a thing that goes out of date.
Ranges are not decorative: the first two digits say which stage refused the program, which is usually the first question.
| Range | Stage |
|---|---|
B01xx | Reading the source — lexer, S-expression reader, parser |
B02xx | Macro expansion, and the ui block it desugars |
B03xx | Names, types and effects — the checker |
B04xx | Placement (B040x) and security (B041x) |
B05xx | The signal graph and the slicer |
B06xx | Modules, interfaces and separate compilation |
B07xx | Tests written in Beck |
Structs§
- Code
Entry - One code, as the index describes it.
Enums§
- Stage
- The stage that raises a code.
Constants§
- INDEX
- Every code the compiler can emit, in code order.