Skip to content

Explanation of E0207 is not what actually happens #62144

@yshui

Description

@yshui
Contributor

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

Activity

added
A-diagnosticsArea: Messages for errors, warnings, and lints
C-bugCategory: This is a bug.
T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
on Jun 26, 2019
added
A-docsArea: Documentation for any part of the project, including the compiler, standard library, and tools
on Jul 25, 2019
removed
A-diagnosticsArea: Messages for errors, warnings, and lints
T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
on Oct 7, 2019
added
T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
on Mar 6, 2020
ayushmishra2005

ayushmishra2005 commented on Jun 6, 2020

@ayushmishra2005
Contributor

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

yshui

yshui commented on Jun 7, 2020

@yshui
ContributorAuthor

@ayushmishra2005 Maybe just don't mention lifetime parameter?

ayushmishra2005

ayushmishra2005 commented on Jun 7, 2020

@ayushmishra2005
Contributor

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

yshui

yshui commented on Jun 8, 2020

@yshui
ContributorAuthor
ayushmishra2005

ayushmishra2005 commented on Jun 8, 2020

@ayushmishra2005
Contributor

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

yshui

yshui commented on Jun 8, 2020

@yshui
ContributorAuthor

@ayushmishra2005 Thanks 👍

added a commit that references this issue on Jun 8, 2020
31a1858
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-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsC-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

      @yshui@Centril@ayushmishra2005@estebank@jonas-schievink

      Issue actions

        Explanation of E0207 is not what actually happens · Issue #62144 · rust-lang/rust