-
Notifications
You must be signed in to change notification settings - Fork 6
Support or reject generic persisted validator impls #12
Copy link
Copy link
Open
Description
Summary
Generic persisted validator impls do not appear to round-trip cleanly through #[validators] expansion.
The macro rebuilds emitted impl blocks from self_ty instead of preserving the original impl generics and where-clause. That looks fragile or broken for shapes like impl<T> DbRow<T>.
This also appears to predate the non-authoritative scanning refactor, but it should be covered explicitly.
Current shape
The validators path keeps item_impl.self_ty and emits new impl blocks from that type. The original item_impl.generics are not preserved on the emitted outer impls.
Relevant code:
statum-macros/src/validators.rsstatum-macros/src/validators/emission.rs
Expected behavior
If generic persisted types are meant to be supported, the macro should preserve:
- impl generic params
- where clauses
- direct compatibility with generic persisted types used by
#[validators]
If they are not meant to be supported, the macro should reject them explicitly with a clear diagnostic.
Suggested acceptance
- add a trybuild case for a generic persisted validators impl
- either support it fully or fail closed with a targeted error
- document the supported shape in validators docs
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels