Skip to content

HIR printing of async fn is broken #60661

Open
@oli-obk

Description

@oli-obk
async fn foo(_: &u8) {}

expanded with rustc --edition 2018 -Z unpretty=hir yields

async fn foo<'_>(__arg0: &'_ u8)
 ->
      ::std::future::from_generator(move ||
                                        {
                                            let __arg0 = __arg0;
                                            let _ = __arg0;
                                        })

which is not correct. We should drop the async, give a return type and print some {} around the function body.

cc @cramertj

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-HIRArea: The high-level intermediate representation (HIR)A-async-awaitArea: Async & AwaitA-prettyArea: Pretty printing (including `-Z unpretty`)AsyncAwait-TriagedAsync-await issues that have been triaged during a working group meeting.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