Skip to content

Using anonymous lifetimes fails to compile #18

Closed
@udoprog

Description

@udoprog

The following:

struct Baz;

#[async_trait]
trait Foo {
    async fn test(value: &Baz);
}

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

#[async_trait]
impl Foo for Bar<'_> {
    async fn test(value: &Baz) {
    }
}

Results in:

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 `oxidize`.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions