From 700c049f64b66f424cda5da3021dfce4462655ca Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Tue, 21 Jul 2026 05:49:00 +0800 Subject: feat(core): add generic parameter `C` to `StructuralData` trait Make `StructuralData` and `StructuralDataSealed` generic over a program collector type to bypass the orphan rule for `group_structural!`. This enables external types to implement `StructuralData` without violating coherence. --- mingling_core/src/lib.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'mingling_core/src/lib.rs') diff --git a/mingling_core/src/lib.rs b/mingling_core/src/lib.rs index 2cb24b9..31476c9 100644 --- a/mingling_core/src/lib.rs +++ b/mingling_core/src/lib.rs @@ -90,8 +90,14 @@ pub mod setup { /// Private API — not intended for direct use. #[doc(hidden)] pub mod __private { + use crate::ProgramCollect; + /// Sealed trait for `StructuralData` — only implementable via derive macro. - pub trait StructuralDataSealed {} + pub trait StructuralDataSealed + where + C: ProgramCollect, + { + } /// Re-export so the derive macro can reference the trait without /// conflicting with the derive macro name at `::mingling::StructuralData`. -- cgit