use-diagnostic-label
Renderer-neutral diagnostic label primitives for RustUse.
Foundation
use-diagnostic-label provides DiagnosticLabelKind and DiagnosticLabel for attaching plain-text context to diagnostics. Labels can point at spans, but they do not render source text, choose colors, or define terminal symbols.
Example
use DiagnosticLabel;
use DiagnosticMessage;
use ;
let start = new.unwrap;
let end = new.unwrap;
let span = without_source.unwrap;
let label = primary;
assert!;
assert_eq!;
Scope
- Labels are context values attached to diagnostics.
- A label may have a span, but does not require one.
- Source rendering, colors, terminal symbols, and snippet formatting are out of scope.
Status
use-diagnostic-label is a pre-1.0 crate with a deliberately small API.