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:
This issue tracks error compatibility with the current version of
rustcfor functions involving HRTBs. This is one of the major features missing from Polonius.Currently,
rustcuses 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.rustcimplementation history (possibly incomplete):'emptycombined with universes rust#70950Relevant 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 therustcborrow-checker has some shortcomings around HRTBs, where it needs to represent constraints likefor <'a, 'b: 'a>, and there are some upcoming features that may complicate things further: