๐Ÿšจ Error Catalog

โ† Language Reference | IR Reference | Target Reference

All Trident compiler diagnostics โ€” errors, warnings, and optimization hints. Derived from the language specification (language.md), target constraints (targets.md), and IR tier rules (ir.md).

This catalog is the source of truth for diagnostics. If a rule in the reference can be violated, the error must exist here. Entries marked (planned) are specification-required but not yet implemented in the compiler.


Derivation Methodology

The catalog is derived systematically from the specification, not reverse-engineered from compiler source. Every violable rule produces at least one diagnostic entry.

The 5-step process

  1. Extract โ€” Scan language.md, targets.md, and ir.md for prohibition keywords: "must", "cannot", "only", "requires", "forbidden", "not supported", "rejected", "maximum", "minimum".

  2. Classify โ€” Is the constraint user-violable? Internal compiler invariants don't need user-facing errors. Only rules that a programmer could break in source code qualify.

  3. Map โ€” Each violable constraint maps to at least one catalog entry. Some constraints produce multiple errors (e.g., "no subtraction" catches -, --, -=).

  4. Audit โ€” Gaps cluster in predictable categories:

    • Excluded-feature diagnostics (every Rust/C keyword users try)
    • Tier-gating for compound features (seal uses sponge internally)
    • Semantic domain errors (inv(0), hash rate mismatches)
    • Attribute argument validation
  5. Maintain โ€” When adding a language feature, add its violation modes to the catalog simultaneously. The spec change and the error entry ship together.

Completeness claim

165 diagnostics cover every user-violable "must"/"cannot"/"only" constraint in the language reference (language.md, grammar.md), targets.md, and ir.md. The derivation was audited by scanning all reference documents for prohibition keywords and cross-referencing each against the catalog.


Categories

Category File Total Impl Planned
Lexer lexer.md 20 7 13
Parser parser.md 29 8 21
Type types.md 40 24 16
Control flow control-flow.md 8 6 2
Size generics size-generics.md 6 4 2
Events events.md 7 5 2
Annotations annotations.md 8 3 5
Module modules.md 10 4 6
Target targets.md 16 3 13
Builtin type builtins.md 7 0 7
Inline assembly assembly.md 2 0 2
Warnings warnings.md 7 3 4
Hints hints.md 5 4 1
Total 165 71 94

๐Ÿ”— See Also

Dimensions

errors
rs/reference/errors
Error Catalog 33 diagnostics across 6 categories. All error codes are stable. Some codes are enforced by proc-macro only, some by rsc lint only, and some by both โ€” see enforcement levels below. | Category | Codes | Count | Spec | Enforcement | |----------|-------|------:|------|-------------| |โ€ฆ

Pages in this namespace

Local Graph