-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
A-trait-systemArea: Trait systemArea: Trait systemC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Description
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
Metadata
Metadata
Assignees
Labels
A-trait-systemArea: Trait systemArea: Trait systemC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.