General plan:
(base, Vec<projection>)
means less re-use overall thoughVec<Projection>
to a per-MIR integer (unlikely to be the first first step)
MutVisitor
in its current design if MIR still owns the Projection
arraysPlace
and get its data without a MIR (you have to do mir.projection_data(index)
)MirPatch
?Deref
and Index
from the list of projections
&mut *(*foo.bar).baz
for example into smaller operationslet tmp0 = &mut *foo.bar
because it will cause new errorsRvalue
(or maybe an Operand
?) which just takes a place(*foo.bar).boo
now becomes let tmp = &*foo.bar; tmp.boo
P0 = LOAD(tmp.bar) // P0 is a "place temporary", meaning that it is a pointer effectively
P1 = LOAD(P0.baz)
X = &P1
Index
from the list of projections
Local
field for the actual index is slightly inconvenientOption<Local>
field to Rvalue::Ref
Local
to Operand
field
from Projection
Projection
s entirely from placesProjection
+Ref
Rvalue
s that create a new local which is a pointer to the projected to place