fn foo<'a>() -> impl Send {
if false {
foo();
}
async {}
}
results in
error[E0283]: type annotations needed: cannot satisfy `{async block@src/main.rs:5:5: 5:10}: Send`
--> src/main.rs:3:9
|
3 | foo();
| ^^^^^
|
= note: cannot satisfy `{async block@src/main.rs:5:5: 5:10}: Send`
we first take stalled coroutine obligations, this encounters foo<'unconstrained> normalizes-to ?infer and foo<'a> normalizes-to {coroutine}. It only takes the second one.
We then apply the defining use to foo<'unconstrained> normalizes-to ?infer which constrains ?infer to {coroutine}. We do not take stalled obligations again, meaning that this normalizes-to goal stays ambiguous :<