Skip to content

v2.0.0

Compare
Choose a tag to compare
@zkat zkat released this 08 Sep 00:38
· 398 commits to main since this release
52c98da

This release overhauls the toplevel/main experience for miette. It adds a
new Report type based on eyre::Report and overhauls various types to fit
into this model, as well as prepare for some future changes in
Rust
that will make it possible to
integrate miette directly with crates like eyre instead of having to use
this specific Report.

On top of that, it includes a couple of nice new features, such as
#[diagnostic(transparent)], which should be super useful when wrapping other
diagnostics with your own types!

Breaking Changes

  • report: anyhow-ify DiagnosticReport (#35) (3f9da04b)
    • DiagnosticReport is now just Report, and is a different, eyre::Report-like type.
    • DiagnosticResult is now just Result.
    • .into_diagnostic() now just transforms the error into a Report.
    • DiagnosticReportPrinter has been replaced with ReportHandler
    • set_printer has been replaced by set_hook
    • code is now optional.
    • .into_diagnostic() no longer takes a code argument.
    • #[diagnostic] is now optional when deriving Diagnostic.

Features

  • derive: Add #[diagnostic(transparent,forward)] (#36) (53f5d6d1)
  • Source: impl Source for str, &str (make &'static str usable for testing) (#40) (50c7a883)
  • source: Remove bound T: Clone from Source implementation for Cow. (#42) (0427c9f9)

Bug Fixes

  • reporter: Only inc the line count if we haven't already done so with '\n' or '\r\n' (#37) (5a474370)
  • printer: Show snippet message for unnamed sources (#39) (84219f6c)