Open
Description
Edit: A draft RFC for this feature was written. Linking here for visibility.
This is really two separate but related features: impl Trait
in trait definitions, and impl Trait
in trait implementations:
// In definitions:
trait Foo {
fn bar() -> impl Debug;
}
// In declarations:
impl Foo for Blah {
fn bar() -> impl Debug;
}
A proposal on this front should address the following issues:
- How to place bounds on the return type of an
impl Trait
-returning impl. - How to use a trait function returning
impl Trait
in a trait object.
@nikomatsakis suggested the possibility of inferring associated types based on the definitions of other items.