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
{{ message }}
Repository navigation
RPITIT causes incorrect "dropped while still borrowed" error in some cases #131490
But the returned iterator in this case doesn't even borrow self, so it doesn't seem like that should be necessary. It also changes the semantic meaning of the returned type to borrow self when the intent of this code is exactly the opposite. Am I missing something?
So the RPITIT wouldn't be capturing self: &Self, but instead it would be capturing Self, the implicit type parameter of the trait. That is to say, he capture we want to avoid is the elided lifetime 'a (which is elided in this case) like:
Activity
compiler-errors commentedon Oct 10, 2024
This was fixed by #116040, but that was not sound. Fixing this is particularly nontrivial.
This may be easier to address soon if #131033 lands and is then stabilized, since you should be able to express the
+'staticas+use<Self>instead.cdhowie commentedon Oct 10, 2024
But the returned iterator in this case doesn't even borrow
self, so it doesn't seem like that should be necessary. It also changes the semantic meaning of the returned type to borrowselfwhen the intent of this code is exactly the opposite. Am I missing something?compiler-errors commentedon Oct 11, 2024
I think so :)
So the RPITIT wouldn't be capturing
self: &Self, but instead it would be capturingSelf, the implicit type parameter of the trait. That is to say, he capture we want to avoid is the elided lifetime'a(which is elided in this case) like:lqd commentedon Oct 11, 2024
Since #131033 landed, this should work on nightly now