Skip to content

Placeholder span used when trait uses a HRTB on itself #98786

Closed

Description

@CAD97

Given the following code: [playground]

pub trait Pack<'a> {
    fn pack()
    where
        Self: for<'x> Pack<'x>;
}

The current output is:

error[E0283]: type annotations needed
  |
  = note: cannot satisfy `Self: Pack<'a>`

This should at least point at the Self: for<'x> Pack<'x> bound.

Ideally, this should work. (It's unclear why it shouldn't, given other where Self: work fine.)

Activity

  1. added
    A-diagnosticsArea: Messages for errors, warnings, and lints
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    on Jul 1, 2022
  2. ChayimFriedman2 commented on Jul 3, 2022

    @ChayimFriedman2
    Contributor

    As for the "it should work", see #84435.

  3. added a commit that references this issue on Jul 8, 2022
    54dde86
  4. added 2 commits that reference this issue on Dec 13, 2022
  5. added 4 commits that reference this issue on Dec 14, 2022
  6. added a commit that references this issue on Dec 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

A-diagnosticsArea: Messages for errors, warnings, and lintsT-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

    No branches or pull requests

    Issue actions