Default the associated return type of unop/binop traits to Self
#20399
Labels
A-trait-system
Area: Trait system
C-feature-request
Category: A feature request, i.e: not implemented / a PR.
T-libs-api
Relevant to the library API team, which will review and decide on the PR/issue.
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
The text was updated successfully, but these errors were encountered: