Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nikomatsakis opened this issue Oct 11, 2023 · 0 comments
Labels
roadmap-tracking-issue Tracks an item on our types team roadmap.
Milestone

Comments

@nikomatsakis
Copy link
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

@nikomatsakis nikomatsakis converted this from a draft issue Oct 11, 2023
@nikomatsakis nikomatsakis added this to the Heat Death milestone Oct 11, 2023
@nikomatsakis nikomatsakis added the roadmap-tracking-issue Tracks an item on our types team roadmap. label Oct 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
roadmap-tracking-issue Tracks an item on our types team roadmap.
Projects
Status: No status
Development

No branches or pull requests

1 participant