Open
Description
Reported issues
- Async function leads to a "more general type" error #71723
- Bad Error Message: error[E0277]: the trait bound
T: Generator<ResumeTy>
is not satisfied #79648 - Async fn disagrees on its own return type ("one of the expected opaque types" vs "one of the found opaque types") #82921
- Problem with GATs, async, and Send-bounds #90696
- Lifetime bounds in auto trait impls prevent trait from being implemented on generators #64552
-
implementation of Debug is not general enough
when making async block into&dyn Future + Send
#87425 - Implementation of trait is not general enough when boxing future returning
<T as Foo<'a>>::Foo
#92415 - GAT
Self: 'a
bounds break someasync
blocks withimpl Trait
#92096 - Bogus
higher-ranked lifetime error
in an async block #102211 - Wrong Send constraint when using a trait with lifetime + associated type in async #60658
- Unhelpful error "one type is more general than the other" in async code #64650
- Why implementation of iterator is not generic enough in async context? #71671
- "Implementation not general enough" with async and projection, fixed by wrapping with
async move
#110339 - async block with futures::stream::Buffered is not Send #104382
- RPITIT with Send trait marker breaks borrow checker #111105
- Higher ranked lifetime error when tryng to see that a future is send. #114046
- Weird type inference around impl Trait and async #124757
- Async code causes error "implementation of
FnOnce
is not general enough" when demanding animpl Send
#126551 - Extremely un-informative error when a future that capture the environment is used as Send #126550
- Confusing: Implementation of
FnOnce
is not general enough #89976 - Bug when using
.flatten()
method that hasItem = &'a T
when calling async function inside loop #126044 -
async_closure
: error: implementation ofAsyncFnOnce
is not general enough #126350 - Weirdness around async function with error "implementation of FnOnce is not general enough" #114177
- Bogus "implementation of
<whatever trait you want>
is not general enough" with RPITIT + async #130113
Cause
We erase lifetime relations of types inside generators, making it impossible in some cases to prove bounds or normalize associated types.
See #64552 (comment) for a more detailed explanation.
Implementation history
Notes
Please keep discussion in this thread at a "meta-level" and open new issues for code that does not compile.
These might not all have the same cause, though it seems plausible that they do. My primary motivation is to try to group all the related issues together so they're easier to keep track of. If we can split them into sub-groups, all the better.
Many of the issues in this list are cribbed from #92449, thanks to @compiler-errors for coming up with that list.