trait Foo { type A; fn test(a: Self::A) -> Self::A { a } } struct Bar(T); impl Foo for Bar { type A = T; } fn main() { let a; a = Bar(123); let b; b = Bar::test(a.0); }