Implement "intersection lifetimes" to improve diagnostics and accept rare impl trait cases #89394
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
A-NLL
Area: Non-lexical lifetimes (NLL)
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
TLDR: The following does not compile but it should
The lifetime of the
if false { a } else { b }
is'a
OR'b
, but right now we can only express'a
AND'b
(as'lifetime: 'a + 'b
).Beyond diagnostics, only impl trait can actually encounter such lifetimes in a somewhat reasonable way.
So the plan is as follows:
Some details: https://rust-lang.zulipchat.com/#narrow/stream/187312-wg-async-foundations/topic/member.20constraints.20PR.20.2389056/near/255496552
Related (purely diagnostics) PR: #89327
The text was updated successfully, but these errors were encountered: