// There are no translation items for constants themselves but their
// initializers might still contain something that produces translation items,
// such as cast that introduce a new vtable.
There are no translation items for constants themselves but their
initializers might still contain something that produces translation items,
such as cast that introduce a new vtable.
There are no translation items for constants themselves but their initializers might still contain something that produces translation items such as cast that introduce a new vtable .
fn add_roots_for_const_item<'a, 'tcx>(scx: &SharedCrateContext<'a, 'tcx>,
                                      const_item_node_id: NodeId,
                                      output: &mut Vec<TransItem<'tcx>>)
{
    let def_id = scx.tcx().map.local_def_id(const_item_node_id);
    // Scan the MIR in order to find function calls, closures, and
    // drop-glue
    let mir = errors::expect(scx.sess().diagnostic(), scx.get_mir(def_id),
        || format!("Could not find MIR for const: {:?}", def_id));
    let empty_substs = scx.empty_substs_for_def_id(def_id);
    let visitor = MirNeighborCollector {
        scx: scx,
        mir: &mir,
        output: output,
        param_substs: empty_substs
    };
    visit_mir_and_promoted(visitor, &mir);
}
fn add_roots_for_const_item < ' a , ' tcx > ( scx : & SharedCrateContext < ' a , ' tcx > , const_item_node_id : NodeId , output : & mut Vec < TransItem < ' tcx > > ) { let def_id = scx . tcx ( ) . map . local_def_id ( const_item_node_id ) ; // Scan the MIR in order to find function calls, closures, and // drop-glue let mir = errors :: expect ( scx . sess ( ) . diagnostic ( ) , scx . get_mir ( def_id ) , | | format ! ( " " def_id ) ) ; let empty_substs = scx . empty_substs_for_def_id ( def_id ) ; let visitor = MirNeighborCollector { scx : scx , mir : & mir , output : output , param_substs : empty_substs } ; visit_mir_and_promoted ( visitor , & mir ) ; }
There are no translation items for constants themselves but their
initializers might still contain something that produces translation items,
such as cast that introduce a new vtable.
There are no translation items for constants themselves but their initializers might still contain something that produces translation items such as cast that introduce a new vtable .
scx
&SharedCrateContext<'a, 'tcx>
const_item_node_id
NodeId
output
&mut Vec<TransItem<'tcx>>