Skip to content

Incorrect "explicit lifetime name needed" error #65285

Closed
@varkor

Description

@varkor
struct Nested<K>(K);

trait X<'a, K: 'a> {
    fn foo<'b, L: X<&'b Nested<K>>>();
}

produces:

error[E0637]: `&` without an explicit lifetime name cannot be used here
 --> src/lib.rs:4:19
  |
4 |     fn foo<'b, L: X<&'b Nested<K>>>();
  |                   ^^^^^^^^^^^^^^^^ explicit lifetime name needed here

despite there being no unnamed &.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-lifetimesArea: Lifetimes / regionsC-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