struct LivenessContext<'me, 'typeck, 'flow, 'tcx> {
    typeck: &'me mut TypeChecker<'typeck, 'tcx>,
    elements: &'me RegionValueElements,
    body: &'me Body<'tcx>,
    move_data: &'me MoveData<'tcx>,
    drop_data: FxHashMap<Ty<'tcx>, DropData<'tcx>>,
    flow_inits: &'me mut ResultsCursor<'flow, 'tcx, MaybeInitializedPlaces<'flow, 'tcx>>,
    local_use_map: &'me LocalUseMap,
}
Expand description

Contextual state for the type-liveness generator.

Fields§

§typeck: &'me mut TypeChecker<'typeck, 'tcx>

Current type-checker, giving us our inference context etc.

§elements: &'me RegionValueElements

Defines the PointIndex mapping

§body: &'me Body<'tcx>

MIR we are analyzing.

§move_data: &'me MoveData<'tcx>

Mapping to/from the various indices used for initialization tracking.

§drop_data: FxHashMap<Ty<'tcx>, DropData<'tcx>>

Cache for the results of dropck_outlives query.

§flow_inits: &'me mut ResultsCursor<'flow, 'tcx, MaybeInitializedPlaces<'flow, 'tcx>>

Results of dataflow tracking which variables (and paths) have been initialized.

§local_use_map: &'me LocalUseMap

Index indicating where each variable is assigned, used, or dropped.

Implementations§

Returns true if the local variable (or some part of it) is initialized at the current cursor position. Callers should call one of the seek methods immediately before to point the cursor to the desired location.

Returns true if the local variable (or some part of it) is initialized in the terminator of block. We need to check this to determine if a DROP of some local variable will have an effect – note that drops, as they may unwind, are always terminators.

Returns true if the path mpi (or some part of it) is initialized at the exit of block.

Warning: Does not account for the result of Call instructions.

Stores the result that all regions in value are live for the points live_at.

Some variable with type live_ty is “drop live” at location – i.e., it may be dropped later. This means that some of the regions in its type must be live at location. The precise set will depend on the dropck constraints, and in particular this takes #[may_dangle] into account.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference’s “Type Layout” chapter for details on type layout guarantees.

Size: 80 bytes