Skip to content

Check constraints arising from higher-rank trait bounds (HRTBs) #172

Open
@ecstatic-morse

Description

@ecstatic-morse

This issue tracks error compatibility with the current version of rustc for functions involving HRTBs. This is one of the major features missing from Polonius.

Currently, rustc uses the concept of Universes (described in detail here to reason about HRTBs. Previously, it used something called the leak check, which I believe still exists in some form.

rustc implementation history (possibly incomplete):

Relevant test cases (definitely incomplete):

Currently, Polonius cannot handle quantified constraints arising from HRTBs. One possible framework, hereditary-harrop predicates, were explored in Niko's blog post. I discussed the implications of allowing a reduced set of these (just the quantifiers) in a later post.

For now, the goal is simply to reach feature parity with current versions of rustc, but the rustc borrow-checker has some shortcomings around HRTBs, where it needs to represent constraints like for <'a, 'b: 'a>, and there are some upcoming features that may complicate things further:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions