Skip to content

poem: resolve_coroutine_interiors happens before handle_opaque_type_uses #239

@lcnr

Description

@lcnr
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 :<

Metadata

Metadata

Assignees

No one assigned

    Labels

    from-craterA regression found via a crater run, not part of our test suite

    Type

    No type

    Projects

    Status

    done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions