HRTBs with two lifetimes: implementation is not general enough when impl uses lifetime bound #113967
Labels
A-higher-ranked
Area: Higher-ranked things (e.g., lifetimes, types, trait bounds aka HRTBs)
A-lifetimes
Area: Lifetimes / regions
C-bug
Category: This is a bug.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
I tried this code:
(Playground)
I expected the program to compile and run without errors because
'b: 'a
irregardless of explicitly adding that bound (as shown by callingfoo
).Instead, this compilation error occurred:
Minimal example:
(Playground)
The minimal example will compile if we replace:
Meta
rustc --version --verbose
:See also
See also: Why can’t I use lifetime bounds in HRTBs? on URLO.
I ran into that problem in a PR #1048 for
regex
where it wasn't trivial to work around. See also comment below in that matter.The text was updated successfully, but these errors were encountered: