Specifically, when a ProjectionElem::Index is encountered, the contained Local is not passed to visit_local, requiring the MutVisitor to also implement process_projection_elem.
This is a footgun that may cause unsound MIR transforms, which is what happened to me while working on #71003. The CopyProp pass also has to explicitly implement process_projection_elem to be sound.
Specifically, when a
ProjectionElem::Indexis encountered, the containedLocalis not passed tovisit_local, requiring theMutVisitorto also implementprocess_projection_elem.This is a footgun that may cause unsound MIR transforms, which is what happened to me while working on #71003. The
CopyProppass also has to explicitly implementprocess_projection_elemto be sound.