Skip to content

Incorrect "explicit lifetime name needed" error #65285

Closed
@varkor

Description

@varkor
Member
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 &.

Activity

added
A-diagnosticsArea: Messages for errors, warnings, and lints
C-bugCategory: This is a bug.
on Oct 10, 2019
added
A-lifetimesArea: Lifetimes / regions
T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
on Oct 10, 2019
Phosphorus15

Phosphorus15 commented on Oct 11, 2019

@Phosphorus15
Contributor

This error report is obviously incorrect, maybe we should elide this for the lifetime inferencer to check ? Or should we simply report an error with different message here, which means a new error code should be created?

added 2 commits that reference this issue on Oct 15, 2019

Rollup merge of rust-lang#65307 - Phosphorus15:master, r=varkor

077a26a

Rollup merge of rust-lang#65307 - Phosphorus15:master, r=varkor

2abce06
added a commit that references this issue on Oct 15, 2019

Rollup merge of rust-lang#65307 - Phosphorus15:master, r=varkor

ff9b99d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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

      Participants

      @estebank@varkor@Phosphorus15

      Issue actions

        Incorrect "explicit lifetime name needed" error · Issue #65285 · rust-lang/rust