#![allow(dead_code)] use derive_bounded::Default; trait Associate { type A: Default; type B: Default; type C: Default; } #[derive(Debug)] struct Holder; impl Associate for Holder { type A = usize; type B = String; type C = u32; } #[derive(Default)] #[bounded_to(T::B, T::C)] struct A { a: T::A, b: B, } #[derive(Default)] #[bounded_to(T::C)] struct B { b: T::B, c: C, } #[derive(Default)] #[bounded_to(T::C)] struct C { c: T::C, } #[derive(Default, Debug)] #[bounded_to(T::C)] struct C2 where T: Associate, { c: T::C, v: V, b: Blah, } #[test] fn default() { let c2 = C2::::default(); dbg!(&c2); }