1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
use pin_project::{pin_project, project}; trait Bar<X> { type Y; } struct Example<A>(A); impl<X, T> Bar<X> for Example<T> { type Y = Option<T>; } #[pin_project] struct Foo<A, B> { _x: <Example<A> as Bar<B>>::Y, } #[project] impl<A, B> Foo<A, B> {}