Skip to content

Error with nested async fn and anonymous lifetimes #63225

Closed
@udoprog

Description

@udoprog

The following breaks on nightly (see playground)

#![feature(async_await)]

struct Foo<'a>(&'a ());

impl Foo<'_> {
    fn test() {
        async fn test() {}
    }
}

With:

error[E0261]: use of undeclared lifetime name `'_`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0261`.
error: Could not compile `playground`.

To learn more, run the command again with --verbose.

CC: dtolnay/async-trait#18

Metadata

Metadata

Assignees

Labels

A-async-awaitArea: Async & AwaitAsyncAwait-PolishAsync-await issues that are part of the "polish" areaC-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