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
AFAICT it is not possible, given a function which takes Pin<&mut Sefl>, to make two function calls in turn which take Pin<&mut Self>. This is because the borrow checker's special logic for permitting this for &mut Self does not apply to Pin<&mut Self>.
I think it would be possible to solve this problem if pin_project provided something like this:
fn project_mut(self: &mut Pin<&mut Self>) -> ....
It seems that this was previously done, but this was changed in #89. Obviously I'm not suggesting it ought to be changed back. But I don't see any reason why it wouldn't be sensible to provide both. I think this should be sound because the outer &mut guarantees unique ownership of the inner &mut.
Would you welcome a MR to provide this other method, perhaps optionally?
AFAICT it is not possible, given a function which takes
Pin<&mut Sefl>
, to make two function calls in turn which takePin<&mut Self>
. This is because the borrow checker's special logic for permitting this for&mut Self
does not apply toPin<&mut Self>
.I think it would be possible to solve this problem if
pin_project
provided something like this:It seems that this was previously done, but this was changed in #89. Obviously I'm not suggesting it ought to be changed back. But I don't see any reason why it wouldn't be sensible to provide both. I think this should be sound because the outer
&mut
guarantees unique ownership of the inner&mut
.Would you welcome a MR to provide this other method, perhaps optionally?
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=a538875119bf28650f67540fe94a440f
The text was updated successfully, but these errors were encountered: