-
Couldn't load subscription status.
- Fork 13.9k
Open
Labels
A-specializationArea: Trait impl specializationArea: Trait impl specializationC-bugCategory: This is a bug.Category: This is a bug.F-specialization`#![feature(specialization)]``#![feature(specialization)]`T-langRelevant to the language teamRelevant to the language team
Description
Suppose I have some trait with a default method:
trait Foo {
fn bar(&self, isize) { .. }
}and I want to add an associated type:
trait Foo {
type Baz = isize;
fn bar(&self, Self::Baz);
}This is a breaking change unless I move the old default method to a new default impl. But there is no way to condition the default impl on choice the choice of associated type. For example:
default impl<A: Foo<Baz = isize>> Foo for A {
fn bar(&self, isize) { .. }
}is prohibited, and both
default impl<A> Foo for A {
type Baz = isize;
fn bar(&self, Self::Baz);
}and
default impl<A> Foo for A {
default type Baz = isize;
fn bar(&self, Self::Baz);
}do the wrong thing.
Metadata
Metadata
Assignees
Labels
A-specializationArea: Trait impl specializationArea: Trait impl specializationC-bugCategory: This is a bug.Category: This is a bug.F-specialization`#![feature(specialization)]``#![feature(specialization)]`T-langRelevant to the language teamRelevant to the language team