-
-
Notifications
You must be signed in to change notification settings - Fork 39
Closed
Labels
C-questionCategory: A questionCategory: A question
Description
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?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-questionCategory: A questionCategory: A question