restrict_precision_for_unsafe in rustc_hir_typeck::upvar - Rust
Description: Truncate `place` so that an `unsafe` block isn’t required to capture it.

Skip to main content

## restrict_precision_for_unsafe

# Function restrict_precision_for_unsafe

Source

    fn restrict_precision_for_unsafe(
        place: Place<'_>,
        curr_mode: UpvarCapture,
    ) -> (Place<'_>, UpvarCapture)

Expand description

Truncate `place` so that an `unsafe` block isn’t required to capture it.

- No projections are applied to raw pointers, since these require unsafe blocks. We capture them completely.
- No projections are applied on top of Union ADTs, since these require unsafe blocks.