Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect "explicit lifetime name needed" error #65285

Closed
varkor opened this issue Oct 10, 2019 · 1 comment · Fixed by #65307
Closed

Incorrect "explicit lifetime name needed" error #65285

varkor opened this issue Oct 10, 2019 · 1 comment · Fixed by #65307
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-lifetimes Area: Lifetimes / regions C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@varkor
Copy link
Member

varkor commented Oct 10, 2019

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 &.

@varkor varkor added A-diagnostics Area: Messages for errors, warnings, and lints C-bug Category: This is a bug. labels Oct 10, 2019
@estebank estebank added A-lifetimes Area: Lifetimes / regions T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 10, 2019
@Phosphorus15
Copy link
Contributor

Phosphorus15 commented Oct 11, 2019

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?

Centril added a commit to Centril/rust that referenced this issue Oct 15, 2019
Try fix incorrect "explicit lifetime name needed"

This pr is trying to fixes rust-lang#65285 .
Centril added a commit to Centril/rust that referenced this issue Oct 15, 2019
Try fix incorrect "explicit lifetime name needed"

This pr is trying to fixes rust-lang#65285 .
@bors bors closed this as completed in ff9b99d Oct 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints A-lifetimes Area: Lifetimes / regions C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants