Registry / utility / miette

miette

JSON →
library7.6.0rscratesunverified

Fancy diagnostic reporting library and protocol for us mere mortals who aren't compiler hackers.

# Cargo.toml [dependencies] miette = "7.6.0"
INSTALL
IMPORT
SIG · MIETTE
M
miette
utilityrustv7.6.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Diagnostic
use miette::Diagnostic;

Defines a custom error with diagnostic annotations and displays it.

use miette::{Diagnostic, SourceSpan}; use thiserror::Error; #[derive(Error, Diagnostic, Debug)] #[error("oops!")] #[diagnostic(help("try again"))] struct MyError { #[source_code] src: String, #[label("here")] bad_bit: SourceSpan, } fn main() -> Result<(), MyError> { Err(MyError { src: "bad code".to_string(), bad_bit: (0, 3).into(), }) }
Debug
Known issues
gotchaRequires the `derive` feature for the Diagnostic derive macro.
fix
Add `miette = { version = "7", features = ["derive"] }` to Cargo.toml.
affects: >=5.0.0
Upgrade
Version history
7.6.0latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources
miette — cargo add miette · libregistry