Skip to main content

## truncate_place_to_len_and_update_capture_kind

# Function truncate_place_to_len_and_update_capture_kind

Source

    fn truncate_place_to_len_and_update_capture_kind<'tcx>(
        place: &mut Place<'tcx>,
        curr_mode: &mut UpvarCapture,
        len: usize,
    )

Expand description

Truncates `place` to have up to `len` projections. `curr_mode` is the current required capture kind for the place. Returns the truncated `place` and the updated required capture kind.

Note: Capture kind changes from `MutBorrow` to `UniqueImmBorrow` if the truncated part of the `place` contained `Deref` of `&mut`.