You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is undocumented whether the inner existential type, impl Copy, is allowed to access 'a or not. In other words, it is equivalent to which of the following?
It looks like this was unintentionally stabilized and changing that now would break the above test (unless we leak the fact that impl Copy captures 'a ??).
On beta
#94081 makes #88236 pass but that seems to be inconsistent with the behavior in stable:
Using the above test on the return type fails, which is quite surprising since removing the lifetime from impl Copy + 'a makes the test pass. playground. And I believe adding a lifetime bound shouldn't change the semantics in this regard.
It would be a backward compatibility risk if we ever want to reject the code in the future.
(Original post in internals forum)
Given the following code (stable sin 1.30!):
It is undocumented whether the inner existential type,
impl Copy, is allowed to access'aor not. In other words, it is equivalent to which of the following?or,
On stable
The behavior in current stable is consistent with the first as shown by:
Assocuses the lifetime'a, the compiler complains aboutImplementation is not general enoughas expected.It looks like this was unintentionally stabilized and changing that now would break the above test (unless we leak the fact that
impl Copycaptures'a??).On beta
#94081 makes #88236 pass but that seems to be inconsistent with the behavior in stable:
Assocuses'a, it gives ICE, see yet another ICE with HRTB and RPIT #95647.impl Copy + 'amakes the test pass. playground. And I believe adding a lifetime bound shouldn't change the semantics in this regard.Meta
stable version:
1.60.0beta version:
1.61.0-beta.3 2022-04-17 2431a974c2dcf82ba513)@rustbot label +T-Lang +A-impl-Trait