Avoid bounding impl trait return type by all input type parameters using existential lifetimes #121
Labels
roadmap-tracking-issue
Tracks an item on our types team roadmap.
Milestone
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 captureT
, sinceT
is not known to be'static
. We mostly recognize this but do not always take advantage of it correctly.cc rust-lang/rust#42940
The text was updated successfully, but these errors were encountered: