I think what you want is to be able to express a function signature that takes an immutable borrow (
index) and a mutable borrow (
self) with a promise it won’t start using the mutable borrow before it stops using the immutable one. From what I know, the NLL will change only how the bodies of function work, the meaning of function signatures will remain unchanged. The extension to function signatures that you want might be possible when the proposed two-stage borrows would get exposed in the typesystem, alghough I’m not sure about it. Also exposing two-stage borrows would increase the complexity of the language significantly.
But from what I understand, these solutions don’t allow a mutable method to consume multiple independent indexes. I think that a good workaround for these would be for the closure to return an operation – playground prototype. Note that I’m certainly not an expert wrt. variance etc. so my code may not be sound.