Open
Description
Consider the Partition
trait:
pub trait Partition<T>: Sized {
fn subdivide(&self) -> Vec<Self>;
/* ... */
}
One could imagine impls of Partition that subdivide into another implementation of Partition. Currently this would have to be worked around by wrapping such partitions in an enum that comprises both. However the following does not compile:
pub trait Partition<T>: Sized {
type Subdivision: Partition<T>;
fn subdivide(&self) -> Vec<Subdivision>;
/* ... */
}
For this to work rust-lang/rust#20551 needs to be fixed (only if such recursion is intended to be allowed, of course).