-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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.