bbatha
July 25, 2018, 3:46pm
20
I think your new &mut
proposal is a restatement of the Ref2Φ type discussed as a possibility for some of NLL work to accept nested &mut self
method calls.
Sure enough.
And as we’re talking about 2-phase lifetimes, let me propose something that should “fix” this (with a change to Index):
Add the possibility of “not-yet-active” lifetimes (ATM every lifetime has been active at some point). Find some hopefully-unhacky way of integrating this with lifetime inference.
Add a Ref2Φ<'immut, 'mutbl, T> where T: 'immut, 'immut: 'mutbl reference type.
Note that
&'a T ~ Ref2Φ<'a, 'empty, T>
&'a mut T ~ Ref2Φ<'a, 'a, T>
Where the equivalence/coercion/what…