Unhelpful higher-ranked lifetime error
in non-async context
#111465
Labels
A-borrow-checker
Area: The borrow checker
A-diagnostics
Area: Messages for errors, warnings, and lints
A-higher-ranked
Area: Higher-ranked things (e.g., lifetimes, types, trait bounds aka HRTBs)
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Here is somewhat minified code producing the unhelpful error message (playground)
This code produces the following error message, which is in my opinon quite unhelpful:
I assume the lifetimes in the code desugar into something like this:
This code produces the same error and does seem vaguely incorrect, as I'd expect the two lifetimes to be at least somewhat related. Specifying the lifetimes in almost any other way resolves the error. For example:
This issue seems closely related to other issues with this error, such as: #102211, #102870, #99492. This issue is probably a duplicate of those, but I'm submitting a new issue, because all the aforementioned issues deal with complex async types and contexts, and apart from #102870 seem to include at least some helpful info in the error message. Also I don't completely understand the error, so I'm not sure whether it should even occur, which seems to be the main focus of those other issues, but I'm fairly confident the error message could provide more information.
Meta
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: