Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upTracking issue for `trait alias` implementation (RFC 1733) #55628
Comments
nikomatsakis
referenced this issue
Nov 2, 2018
Open
trait alias `dyn` type equality doesn't work #55629
This comment has been minimized.
This comment has been minimized.
|
Good summary. Thanks for writing this up. |
This comment has been minimized.
This comment has been minimized.
|
Have we considered blocking stabilization on lazy normalization? trait Foo<X> {}
type Bar<X: ExtraBound> = dyn Foo<X>;
fn bad<X>(_: &Bar<X>) {}
trait Foo2<X: ExtraBound> = Foo<X>;
fn bad2<X>(_: &dyn Foo2<X>) {}The alternative, to consider |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
nikomatsakis commentedNov 2, 2018
•
edited by arielb1
This is the tracking issue for implementing (not discussing the design) RFC rust-lang/rfcs#1733. It is a subissue of #41517.
Current status
Once #55101 lands, many aspects of trait aliases will be implemented. However, some known limitations remain. These are mostly pre-existing limitations of the trait checker that we intend to lift more generally (see each case below for notes).
Well-formedness requirements. We currently require the trait alias to be well-formed. So, for example,
trait Foo<T: Send> { } trait Bar<T> = Foo<T>is an error. We intend to modify this behavior as part of implementing the implied bounds RFC (#44491).Trait object associated types. If you have
trait Foo = Iterator<Item =u32>, you cannot use the trait object typedyn Foo. This is a duplicate of #24010.Trait object equality. If you have
trait Foo { }andtrait Bar = Foo, we do not currently considerdyn Fooanddyn Barto be the same type. Tracking issue #55629.Pending issues to resolve
Deviations and/or clarifications from the RFC
This section is for us to collect notes on deviations from the RFC text, or clarifications to unresolved questions.
PR history
Other links