Description
This is a roadmap item for wg-async. You can view the roadmap here: wg-async roadmap
Allow -> impl Trait
methods in traits, e.g.
trait Iterable {
fn iter(&self) -> impl Iterator;
}
Open questions
Semver hazard caused by auto trait leakage
Auto traits leak from public functions using async fn
and return-position impl Trait
. This is a pre-existing issue.
Once we make these features available within traits we have a chance to proactively make sure crate authors don't accidentally stabilize auto traits. For example, we could make it a lint or a hard error if you have a publicly-accessible function that is not explicit about its auto traits.
It's obvious how to do this for -> impl Trait
(add + Send
and probably #[refine]
), but not async fn
. We could also punt on this and make it a lint for all uses of -> impl Trait
later (not only inside traits), upgrading to a hard error over an edition.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status