Skip to content

Avoid bounding impl trait return type by all input type parameters using existential lifetimes #121

Open
@nikomatsakis

Description

@nikomatsakis
Contributor

Impl trait return types are currently bounded by all type parameters and will eventually be bounded by all lifetime parameters too. But sometimes the trait bounds imply they cannot capture generic parameters, e.g., fn foo<T>() -> impl 'static cannot capture T, since T is not known to be 'static. We mostly recognize this but do not always take advantage of it correctly.

cc rust-lang/rust#42940

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

    Status

    No status

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @nikomatsakis

        Issue actions

          Avoid bounding impl trait return type by all input type parameters using existential lifetimes · Issue #121 · rust-lang/types-team