Skip to content

447#460

Merged
RAprogramm merged 1 commit into
mainfrom
447
Jul 5, 2026
Merged

447#460
RAprogramm merged 1 commit into
mainfrom
447

Conversation

@RAprogramm

Copy link
Copy Markdown
Owner

Closes #447

thiserror 2.x derive edge-case parity: audited five edge-case classes, fixed two real derive bugs, implemented one missing feature, locked the rest in with tests.

Fixed

  • r#source raw-identifier fields: implicit source inference already skipped them correctly, but they were unusable in #[error(\"{source}\")] templates ('unknown field') — member resolution now compares unraw forms (thiserror 2.0 chore(deps): bump itoa from 1.0.16 to 1.0.17 #350 parity)
  • Derives on #[deprecated] types/variants emitted deprecation warnings from generated code — expansion now wrapped in #[allow(deprecated)] const _ only when the input is deprecated

Implemented

  • Enum-level #[error(fmt = path)] — shared formatter for variants without their own #[error], per-variant overrides (fmt/template/transparent) respected; enum-level templates rejected with specific errors (thiserror 2.0 parity)

Verified working (tests added, no fix needed)

  • DST final field (tail: [u8]) derives and implements Display/Error
  • Associated types of generic params: masterror-derive propagates declared bounds verbatim and never infers wrong T: Display bounds — the thiserror 2.0.10 bug class can't occur
  • Lint hygiene under deny(deprecated, unused_qualifications, clippy::needless_lifetimes, clippy::elidable_lifetime_names, clippy::allow_attributes, clippy::missing_inline_in_public_items)

Tests

10-test edge-case integration file, new trybuild pass/fail cases (enum-level fmt, rejected enum-level template), unit tests for raw-ident handling. Full workspace suite (580 derive unit tests), doctests (176), clippy zero warnings, nightly fmt — all green.

@codecov

codecov Bot commented Jul 5, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.96954% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
masterror-derive/src/input/parse_attr.rs 97.22% 3 Missing ⚠️
masterror-derive/src/input/parse.rs 96.87% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@RAprogramm RAprogramm merged commit d29ff7b into main Jul 5, 2026
29 checks passed
@RAprogramm RAprogramm deleted the 447 branch July 5, 2026 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Derive edge-case coverage: thiserror 2.x parity

1 participant