-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Closed
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
Unconstrained lifetime parameters are actually allowed:
Unlike what's described here:
rust/src/librustc_typeck/error_codes.rs
Lines 1941 to 1950 in d3e2cec
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:
ExpHP
Metadata
Metadata
Assignees
Labels
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
ayushmishra2005 commentedon Jun 6, 2020
@yshui I would like to address this. What should be error message for E0207?
yshui commentedon Jun 7, 2020
@ayushmishra2005 Maybe just don't mention lifetime parameter?
ayushmishra2005 commentedon Jun 7, 2020
@yshui I think this has been fixed already. Can you please try again?
yshui commentedon 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 commentedon Jun 8, 2020
@yshui Sorry My bad. I missed checking this file. Let me fix and raise PR.
Removed lifetime parameters from Explanation of E0207 rust-lang#62144
yshui commentedon Jun 8, 2020
@ayushmishra2005 Thanks 👍
Rollup merge of rust-lang#73124 - ayushmishra2005:correction_in_expla…