Support #[cfg] in pymodule with#6975
Conversation
|
Caution Review failedThe pull request is closed. 📝 WalkthroughWalkthroughRefactors pymodule attribute parsing: introduces Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
b221086 to
306d939
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@crates/derive-impl/src/pymodule.rs`:
- Around line 45-80: The parser for PyModuleArgs currently assigns to with_items
when it encounters a with(...) block, so later with(...) blocks overwrite
earlier ones; in the impl syn::parse::Parse for PyModuleArgs (the parse
function) change the handling inside the "if ident == \"with\"" branch to merge
parsed items into the existing with_items (use Vec::extend or similar on the
Vec<WithItem>) instead of replacing it, ensuring you still parse the trailing
comma and continue; reference the with_items local variable and the parse of
syn::punctuated::Punctuated::<WithItem,...>::parse_terminated(...) as the
locations to modify.
Summary by CodeRabbit
New Features
Refactor
Bug Fixes