fn convert_to_hir_projections_and_truncate_for_capture(
    mir_projections: &[PlaceElem<'_>]
) -> Vec<ProjectionKind>
Expand description

Given a list of MIR projections, convert them to list of HIR ProjectionKind. The projections are truncated to represent a path that might be captured by a closure/coroutine. This implies the vector returned from this function doesn’t contain ProjectionElems Downcast, ConstantIndex, Index, or Subslice because those will never be part of a path that is captured by a closure. We stop applying projections once we see the first projection that isn’t captured by a closure.