Yes, thats exactly what I would like to do! Your wording is much better
Thanks also for the links to the code, its very interesting — I’ll play around with it, and maybe get inspired.
After reading the blog post few more times I believe that you are right, and that the analysis of the lifetime seems to stop at the method boundary (in theory, it doesn’t have to, but that would call for a more complex graph analysis). However, if I understand it correctly, the current proposal should allow for destructuring the index in the function signature, e.g.:
fn consume<'a, 'b: 'a>(&'b mut self, (internal_index:UnsafeIndex, _): Index<'a>)
The idea here is that index is dropped (and the associated lifetime/phantom borrow is released) before the method is called. The ‘safe’ index could then be encoded as a tuple of an ‘unsafe’ index + a marker.