Expand description
Generic diagnostic engine for tools that need rich, rustc-style error output. Plug in your own error code enum, attach spans + labels + suggestions, and render in pretty (color), plain, or JSON modes.
See examples/ for end-to-end demos.
Macros§
- diag
- Shorthand for
Diagnostic::new(...)with optional label/note/help/suggestion.
Structs§
- Diagnostic
- Diagnostic
Engine - Diagnostic
Formatter - Label
- Render
Options - Tunables for rendered output.
- Source
Cache - Pre-split source cache. Build once per source string, reuse for many diagnostics.
- Span
- Source span.
- Suggestion
- Code rewrite suggestion attached to a diagnostic.
Enums§
- Applicability
- How confident the suggestion is — controls whether IDEs may auto-apply it.
- Label
Style - Severity
- Severity of a diagnostic.
Traits§
- Diagnostic
Code - Implement this on your error enum to plug into the diagnostic system.