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.rs
statum-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
Summary
Generic persisted validator impls do not appear to round-trip cleanly through
#[validators]expansion.The macro rebuilds emitted impl blocks from
self_tyinstead of preserving the originalimplgenerics and where-clause. That looks fragile or broken for shapes likeimpl<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_tyand emits new impl blocks from that type. The originalitem_impl.genericsare not preserved on the emitted outer impls.Relevant code:
statum-macros/src/validators.rsstatum-macros/src/validators/emission.rsExpected behavior
If generic persisted types are meant to be supported, the macro should preserve:
#[validators]If they are not meant to be supported, the macro should reject them explicitly with a clear diagnostic.
Suggested acceptance