# What changed in thiserror

> 11 changes in thiserror 2 from its official release notes, upgrade guides and advisories: 4 breaking, 4 new APIs and options. Each one cited. Sources checked 2026-11-30. HTML: https://unstale.sh/cargo/thiserror/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## thiserror 2

### Breaking changes

- Fields shadowed by an explicit named format argument no longer contribute inferred trait bounds. (2.0.0) — [release notes](https://github.com/dtolnay/thiserror/releases/tag/2.0.0)
- Tuple structs and variants cannot combine numerical field access with extra positional format arguments because the references are ambiguous. (2.0.0) — [release notes](https://github.com/dtolnay/thiserror/releases/tag/2.0.0)
- Raw identifiers for keyword-named fields are no longer accepted in format strings; use the unraw name instead. (2.0.0) — [release notes](https://github.com/dtolnay/thiserror/releases/tag/2.0.0)
- Code invoking thiserror's derive must have a direct dependency on the thiserror crate, regardless of the error data structure. (2.0.0) — [release notes](https://github.com/dtolnay/thiserror/releases/tag/2.0.0)

### New APIs and options

- The `#[error(fmt = path::to::myfmt)]` attribute lets enum variants define formatting logic out of line. (2.0.0) — [release notes](https://github.com/dtolnay/thiserror/releases/tag/2.0.0)
- Using `r#source` as a field name opts out of treating the field as an error's `Error::source()`. (2.0.0) — [release notes](https://github.com/dtolnay/thiserror/releases/tag/2.0.0)
- The default `std` Cargo feature can be disabled to use thiserror without its standard library dependency. (2.0.0) — [release notes](https://github.com/dtolnay/thiserror/releases/tag/2.0.0)
- An individually transparent variant can override an enum-level format message. (2.0.0) — [release notes](https://github.com/dtolnay/thiserror/releases/tag/2.0.0)

### Behavior and default changes

- Infinite recursion in a generated `Display` implementation now produces an `unconditional_recursion` warning. (2.0.0) — [release notes](https://github.com/dtolnay/thiserror/releases/tag/2.0.0)

### Tooling

- Suppresses the redundant_field_names clippy lint in generated code, avoiding lint reports for that code. (2.0.20) — [release notes](https://github.com/dtolnay/thiserror/releases/tag/2.0.20)

### Fixes and other changes

- Fixes parsing of generic unit variants in display expressions. (2.0.21) — [release notes](https://github.com/dtolnay/thiserror/releases/tag/2.0.21)
