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

Explanation of E0207 is not what actually happens #62144

Closed
yshui opened this issue Jun 26, 2019 · 6 comments · Fixed by #73124
Closed

Explanation of E0207 is not what actually happens #62144

yshui opened this issue Jun 26, 2019 · 6 comments · Fixed by #73124
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@yshui
Copy link
Contributor

yshui commented Jun 26, 2019

Unconstrained lifetime parameters are actually allowed:

https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=e4deca509f64a6d600ae49904e966124

Unlike what's described here:

E0207: r##"
Any type parameter or lifetime parameter of an `impl` must meet at least one of
the following criteria:
- it appears in the _implementing type_ of the impl, e.g. `impl<T> Foo<T>`
- for a trait impl, it appears in the _implemented trait_, e.g.
`impl<T> SomeTrait<T> for Foo`
- it is bound as an associated type, e.g. `impl<T, U> SomeTrait for T
where T: AnotherTrait<AssocType=U>`

For comparison, unconstrained type parameters do generate error:

https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=a4d2a865a8a311e0eb46f8ed8583c671

@Centril Centril added A-diagnostics Area: Messages for errors, warnings, and lints C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jun 26, 2019
@estebank estebank added the A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools label Jul 25, 2019
@estebank estebank removed A-diagnostics Area: Messages for errors, warnings, and lints T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Oct 7, 2019
@jonas-schievink jonas-schievink added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Mar 6, 2020
@ayushmishra2005
Copy link
Contributor

@yshui I would like to address this. What should be error message for E0207?

@yshui
Copy link
Contributor Author

yshui commented Jun 7, 2020

@ayushmishra2005 Maybe just don't mention lifetime parameter?

@ayushmishra2005
Copy link
Contributor

@yshui I think this has been fixed already. Can you please try again?

@yshui
Copy link
Contributor Author

yshui commented Jun 8, 2020

@ayushmishra2005 I don't think it has been: https://github.com/rust-lang/rust/blob/master/src/librustc_error_codes/error_codes/E0207.md still mentions lifetime parameter.

@ayushmishra2005
Copy link
Contributor

@yshui Sorry My bad. I missed checking this file. Let me fix and raise PR.

@yshui
Copy link
Contributor Author

yshui commented Jun 8, 2020

@ayushmishra2005 Thanks 👍

@bors bors closed this as completed in 31a1858 Jun 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: Documentation for any part of the project, including the compiler, standard library, and tools 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.

5 participants