Skip to content

"computing type of ...::{opaque#0}" query cycle in async fn w/ auto trait obligations. #104343

Open
@inanna-malick

Description

@inanna-malick

I tried this code using GATs and the async feature

https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=8856ef117840a1d3b4be93441c2b36b1

I expected it to compile. For reference, the same code implemented using manual .then future chaining compiles as shown here:

https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=8cd834a4ff4d4b969d6ba1de9db91fee

Note that the above are built with nightly 1.67, but the same error occurs on stable 1.65.

Tagging @jackh726 as suggested by @jyn514

Note that GATs are an amazing feature that I'm incredibly grateful to you for implementing, and also that I'm not surprised that my extremely galaxy brained Haskell shenanigans hit some edge case.


EDIT(@eddyb): changed title as per #104343 (comment) - this does not seem to involve GATs at all, just the unfortunate interaction of async fn's -> impl Future desugaring + the "leaky" auto trait semantics of -> impl Trait.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-auto-traitsArea: auto traits (e.g., `auto trait Send {}`)A-impl-traitArea: `impl Trait`. Universally / existentially quantified anonymous types with static dispatch.C-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions