Function rustc_mir_build::build::expr::as_place::convert_to_hir_projections_and_truncate_for_capture [−][src]
fn convert_to_hir_projections_and_truncate_for_capture<'tcx>(
mir_projections: &[PlaceElem<'tcx>]
) -> Vec<HirProjectionKind>
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/generator. 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 captued by a closure. We stop applying projections once we see the first
projection that isn’t captured by a closure.