Skip to content

Are blanket Future impls necessary? #60645

Description

We currently have the following blanket impls:

impl<F: ?Sized + Future + Unpin> Future for &mut F
{ ... }

impl<F: ?Sized + Future + Unpin> Future for Box<F>
{ ... }

impl<F: Future> Future for AssertUnwindSafe<F>
{ ... }

impl<P> Future for Pin<P>
where
    P: Unpin + ops::DerefMut,
    P::Target: Future,
{ ... }

All of these blanket impls are on types that deref to something that implements Future. But then there are similar types that don't have a blanket Future implementation - for example, MutexGuard.

I wonder if these impls are necessary in practice if fut.await will auto-deref fut to a value that implements Future. I'm opening this issue just to double-check whether we really want to stabilize those blanket impls.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions