Diagnostic codes: the stable identity of a diagnostic, independent of its wording.
rustc-shaped — E0042, W0003 — because that shape is already what a user expects to be
able to look up (fugue explain E0042), grep a build log for, or write into a regression
fixture's expectations. Wording changes freely; a code never does.
Equations
- instReprSeverity.repr Severity.error prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Severity.error")).group prec✝
- instReprSeverity.repr Severity.warning prec✝ = Repr.addAppParen (Std.Format.nest (if prec✝ ≥ 1024 then 1 else 2) (Std.Format.text "Severity.warning")).group prec✝
Instances For
Equations
- instReprSeverity = { reprPrec := instReprSeverity.repr }
Equations
- instInhabitedSeverity = { default := instInhabitedSeverity.default }
Equations
- instBEqSeverity.beq x✝ y✝ = (x✝.ctorIdx == y✝.ctorIdx)
Instances For
Equations
- instBEqSeverity = { beq := instBEqSeverity.beq }
Instances For
Equations
- instHashableSeverity = { hash := instHashableSeverity.hash }
Equations
- instOrdSeverity.ord x✝ y✝ = compare x✝.ctorIdx y✝.ctorIdx
Instances For
Equations
- instOrdSeverity = { compare := instOrdSeverity.ord }
The letter this severity's codes start with.
Equations
- Severity.error.letter = 'E'
- Severity.warning.letter = 'W'
Instances For
A diagnostic's code: a severity and a four-digit number, e.g. E0042.
A structure over Fin 10000 rather than a String, so a malformed code cannot be constructed in
the first place — every code that exists renders in the one canonical form, and explain's
argument either parses into this type or was never a code at all.
- severity : Severity
Error or warning.
- number : Fin 10000
The number, unique within the whole compiler (not per severity, not per stage).
Instances For
Equations
Instances For
Equations
- instReprDiagnosticCode = { reprPrec := instReprDiagnosticCode.repr }
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
Equations
Instances For
Equations
Equations
Equations
Instances For
Equations
- instOrdDiagnosticCode = { compare := instOrdDiagnosticCode.ord }
Equations
Instances For
Equations
- DiagnosticCode.instToString = { toString := DiagnosticCode.toString }
Parse a code back from its printed form; none if s is not one. Strict: the letter must be
E/W, and exactly four digits must follow — E42 and banana are both simply not codes.
Equations
- One or more equations did not get rendered due to their size.