/// Combines liveness analysis with initialization analysis to
/// determine which variables are live at which points, both due to
/// ordinary uses and drops. Returns a set of (ty, location) pairs
/// that indicate which types must be live at which point in the CFG.
/// This vector is consumed by `constraint_generation`.
///
/// NB. This computation requires normalization; therefore, it must be
/// performed before
Combines liveness analysis with initialization analysis to
determine which variables are live at which points, both due to
ordinary uses and drops. Returns a set of (ty, location) pairs
that indicate which types must be live at which point in the CFG.
This vector is consumed by `constraint_generation`.

NB. This computation requires normalization; therefore, it must be
performed before
Combines liveness analysis with initialization analysis to determine which variables are live at which points both due to ordinary uses and drops . Returns a set of ( ty location ) pairs that indicate which types must be live at which point in the CFG . This vector is consumed by ` constraint_generation ` . NB . This computation requires normalization ; therefore it must be performed before
pub(super) fn generate<'gcx, 'tcx>(
    cx: &mut TypeChecker<'_, 'gcx, 'tcx>,
    mir: &Mir<'tcx>,
    flow_inits: &mut FlowAtLocation<MaybeInitializedPlaces<'_, 'gcx, 'tcx>>,
    move_data: &MoveData<'tcx>,
) -> (LivenessResults<LocalWithRegion>, NllLivenessMap) {
    let free_regions = {
        let borrowck_context = cx.borrowck_context.as_ref().unwrap();
        regions_that_outlive_free_regions(
            cx.infcx.num_region_vars(),
            &borrowck_context.universal_regions,
            &borrowck_context.constraints.outlives_constraints,
        )
    };
    let liveness_map = NllLivenessMap::compute(cx.tcx(), &free_regions, mir);
    let liveness = LivenessResults::compute(mir, &liveness_map);
    // For everything else, it is only live where it is actually used.
    if !liveness_map.is_empty() {
        let mut generator = TypeLivenessGenerator {
            cx,
            mir,
            liveness: &liveness,
            flow_inits,
            move_data,
            drop_data: FxHashMap(),
            map: &liveness_map,
        };
        for bb in mir.basic_blocks().indices() {
            generator.add_liveness_constraints(bb);
        }
    }
    (liveness, liveness_map)
}
pub ( super ) fn generate < ' gcx , ' tcx > ( cx : & mut TypeChecker < ' _ , ' gcx , ' tcx > , mir : & Mir < ' tcx > , flow_inits : & mut FlowAtLocation < MaybeInitializedPlaces < ' _ , ' gcx , ' tcx > > , move_data : & MoveData < ' tcx > , ) -> ( LivenessResults < LocalWithRegion > , NllLivenessMap ) { let free_regions = { let borrowck_context = cx . borrowck_context . as_ref ( ) . unwrap ( ) ; regions_that_outlive_free_regions ( cx . infcx . num_region_vars ( ) , & borrowck_context . universal_regions , & borrowck_context . constraints . outlives_constraints , ) } ; let liveness_map = NllLivenessMap :: compute ( cx . tcx ( ) , & free_regions , mir ) ; let liveness = LivenessResults :: compute ( mir , & liveness_map ) ; // For everything else, it is only live where it is actually used. if ! liveness_map . is_empty ( ) { let mut generator = TypeLivenessGenerator { cx , mir , liveness : & liveness , flow_inits , move_data , drop_data : FxHashMap ( ) , map : & liveness_map , } ; for bb in mir . basic_blocks ( ) . indices ( ) { generator . add_liveness_constraints ( bb ) ; } } ( liveness , liveness_map ) }
Combines liveness analysis with initialization analysis to
determine which variables are live at which points, both due to
ordinary uses and drops.
Combines liveness analysis with initialization analysis to determine which variables are live at which points both due to ordinary uses and drops .
cx
&mut TypeChecker<'_, 'gcx, 'tcx>
mir
&Mir<'tcx>
flow_inits
&mut FlowAtLocation<MaybeInitializedPlaces<'_, 'gcx, 'tcx>>
move_data
&MoveData<'tcx>