It is the only projection element that uses another local besides the place's base local, and requires special care in many circumstances. All other ProjectionElems perform static operations that do not depend on runtime values.
In #71003, I initially did not handle this special case, which would have resulted in an unsound optimization. The visitor logic for them was also broken (fixed in #71013) because it was missing a special case.
I'm not sure what to adequately replace them with. It seems like Rvalue::Index would be a reasonable choice, but it might have other drawbacks.
cc @rust-lang/wg-mir-opt
It is the only projection element that uses another local besides the place's base local, and requires special care in many circumstances. All other
ProjectionElems perform static operations that do not depend on runtime values.In #71003, I initially did not handle this special case, which would have resulted in an unsound optimization. The visitor logic for them was also broken (fixed in #71013) because it was missing a special case.
I'm not sure what to adequately replace them with. It seems like
Rvalue::Indexwould be a reasonable choice, but it might have other drawbacks.cc @rust-lang/wg-mir-opt