Skip to content

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

Closed
@CAD97

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.)

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