NLL issue when using DerefMut to access fields through a Pin, causing multiple mutable borrow error #63993
Labels
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
NLL-complete
Working towards the "valid code works" goal
The code below doesn't compile due to multiple mutable borrows, however the exact same code without the
std::pin::Pin
compiles fine actually. My expectation is however that the code would obviously compile fine in both cases.The exception raised is:
I'm able to get the code to compile also by creating additional scopes around the areas where I'm supposedly borrowing
self
like this:Although obviously that's pretty awkward. I'm told that this could possibly be a bug in the NLL, but I'm pretty new to the language so I'm just reporting this with a short reproducible example.
Hope it helps.
The text was updated successfully, but these errors were encountered: