Sourced from thiserror's releases.
2.0.3
- Support the same Path field being repeated in both Debug and Display representation in error message (#383)
- Improve error message when a format trait used in error message is not implemented by some field (#384)
2.0.2
- Fix hang on invalid input inside #[error(...)] attribute (#382)
2.0.1
- Support errors that contain a dynamically sized final field (#375)
- Improve inference of trait bounds for fields that are interpolated multiple times in an error message (#377)
2.0.0
Breaking changes
Referencing keyword-named fields by a raw identifier like
{r#type}
inside a format string is no longer accepted; simply use the unraw name like{type}
(#347)This aligns thiserror with the standard library's formatting macros, which gained support for implicit argument capture later than the release of this feature in thiserror 1.x.
#[derive(Error, Debug)] #[error("... {type} ...")] // Before: {r#type} pub struct Error { pub r#type: Type, }
Trait bounds are no longer inferred on fields whose value is shadowed by an explicit named argument in a format message (#345)
// Before: impl<T: Octal> Display for Error<T> // After: impl<T> Display for Error<T> #[derive(Error, Debug)] #[error("{thing:o}", thing = "...")] pub struct Error<T> { thing: T, }
Tuple structs and tuple variants can no longer use numerical
{0}
{1}
access at the same time as supplying extra positional arguments for a format message, as this makes it ambiguous whether the number refers to a tuple field vs a different positional arg (#354)#[derive(Error, Debug)] #[error("ambiguous: {0} {}", $N)] // ^^^ Not allowed, use #[error("... {0} {n}", n = $N)] pub struct TupleError(i32);
Code containing invocations of thiserror's
derive(Error)
must now have a direct dependency on thethiserror
crate regardless of the error data structure's contents (#368, #369, #370, #372)Features
... (truncated)
15fd26e
Release 2.0.37046023
Simplify how has_bonus_display is accumulated9cc1d0b
Merge pull request #384
from dtolnay/nowrap1d040f3
Use Var wrapper only for Pointer formatting6a6132d
Extend no-display ui test to cover another fmt traita061beb
Merge pull request #383
from dtolnay/both6388293
Support Display and Debug of same path in error messagedc0359e
Defer binding_value construction520343e
Add test of Debug and Display of paths49be39d
Release 2.0.2