refactor: remove proc-macro-error2 dependency#113
Merged
Conversation
メンテナンス状況に左右される外部依存を排除するため、proc-macro-error2 を削除し、 既存の `crate::Error` / `to_compile_errors()` 機構にエラー処理を統一する。 - `SingleIdentPath::new` / `NamedField::new` / `UnnamedField::new` を `Result<_, crate::Error>` 化し、panic ベースの `abort\!` を排除 - `collect_serde_rename_map` を `Result<RenameMap, crate::Errors>` 化 - `#[proc_macro_error]` 属性と依存宣言を削除 - エラーメッセージと span は従来と同一の表示を維持 Closes #112 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jun 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Removes the
proc-macro-error2dependency to reduce reliance on external crates whose maintenance status is uncertain, and unifies all derive-macro error handling under the existingcrate::Error/to_compile_errors()mechanism.SingleIdentPath::new/NamedField::new/UnnamedField::newreturnResult<_, crate::Error>, completely eliminating panic-basedabort!(no panic path remains other thanparse_macro_input!)collect_serde_rename_mapto returnResult<RenameMap, crate::Errors>, propagating with?at its callers (named_struct_derive/enum_derive)#[proc_macro_error]attribute and the dependency declarations from Cargo.tomlErrorscollection mechanism, multiple errors can be reported at onceUnder the hood,
proc-macro-error2is just a wrapper that catchesabort!panics viacatch_unwindand renders them ascompile_error!. This crate already has an equivalent Result-based mechanism, so the dependency could be replaced without adding any custom implementation.Closes #112
Validation
cargo build --workspace— passescargo test --workspace --all-features— all 32 test suites passcargo fmt -- --check/cargo clippy --workspace --all-features— zero warningscargo tree -p serde_valid_derive— no remaining reference to proc-macro-error2#[validate(foo::bar)]and confirmed the same span-accurate error output as before:🤖 Generated with Claude Code