Because that's the common case and it's an ergonomic win. For example:
trait Add<RHS=Self> {
type Result = Self; // <-- default type
fn add(self, RHS) -> Self::Result;
}
Would let us write trait Int: Add + Sub + ... instead of trait Int: Add<Result=Self> + Sub<Result=Self> + ....
This has to wait until default type parameters is implemented for associated types (#19476).
cc @aturon / @nikomatsakis
Because that's the common case and it's an ergonomic win. For example:
Would let us write
trait Int: Add + Sub + ...instead oftrait Int: Add<Result=Self> + Sub<Result=Self> + ....This has to wait until default type parameters is implemented for associated types (#19476).
cc @aturon / @nikomatsakis