1 #![feature(generic_associated_types)]
9 pub trait HasChildrenOf {
14 fn ref_children<'a>(&'a self) -> Vec<Self::TRef<'a>>;
15 fn take_children(self) -> Vec<Self::T>;
18 impl<Left, Right> HasChildrenOf for Either<Left, Right>
23 type T = Either<Left::T, Right::T>;
24 // We used to error below because the where clause doesn't match the trait.
25 // Now, we error early on the trait itself.
28 <Left as HasChildrenOf>::T: 'a,
29 <Right as HasChildrenOf>::T: 'a
30 = Either<&'a Left::T, &'a Right::T>;
32 fn ref_children<'a>(&'a self) -> Vec<Self::TRef<'a>> {
36 fn take_children(self) -> Vec<Self::T> {