pub fn map_decoded_item<'ast, F: FoldOps>(map: &Map<'ast>,
                                          parent_def_path: DefPath,
                                          parent_def_id: DefId,
                                          ii: InlinedItem,
                                          fold_ops: F)
                                          -> &'ast InlinedItem {
    let mut fld = IdAndSpanUpdater { fold_ops: fold_ops };
    let ii = match ii {
        II::Item(i) => II::Item(i.map(|i| fld.fold_item(i))),
        II::TraitItem(d, ti) => {
            II::TraitItem(fld.fold_ops.new_def_id(d),
                          ti.map(|ti| fld.fold_trait_item(ti)))
        }
        II::ImplItem(d, ii) => {
            II::ImplItem(fld.fold_ops.new_def_id(d),
                         ii.map(|ii| fld.fold_impl_item(ii)))
        }
        II::Foreign(i) => II::Foreign(i.map(|i| fld.fold_foreign_item(i)))
    };

    let ii = map.forest.inlined_items.alloc(ii);
    let ii_parent_id = fld.new_id(DUMMY_NODE_ID);

    let defs = &mut *map.definitions.borrow_mut();
    let mut def_collector = DefCollector::extend(ii_parent_id,
                                                 parent_def_path.clone(),
                                                 parent_def_id,
                                                 defs);
    def_collector.walk_item(ii, map.krate());

    let mut collector = NodeCollector::extend(map.krate(),
                                              ii,
                                              ii_parent_id,
                                              parent_def_path,
                                              parent_def_id,
                                              mem::replace(&mut *map.map.borrow_mut(), vec![]));
    ii.visit(&mut collector);
    *map.map.borrow_mut() = collector.map;

    ii
}
/// Used for items loaded from external crate that are being inlined into this
/// crate.
Used for items loaded from external crate that are being inlined into this
crate.
Used for items loaded from external crate that are being inlined into this crate .
pub fn map_decoded_item<'ast, F: FoldOps>(map: &Map<'ast>,
                                          parent_def_path: DefPath,
                                          parent_def_id: DefId,
                                          ii: InlinedItem,
                                          fold_ops: F)
                                          -> &'ast InlinedItem {
    let mut fld = IdAndSpanUpdater { fold_ops: fold_ops };
    let ii = match ii {
        II::Item(i) => II::Item(i.map(|i| fld.fold_item(i))),
        II::TraitItem(d, ti) => {
            II::TraitItem(fld.fold_ops.new_def_id(d),
                          ti.map(|ti| fld.fold_trait_item(ti)))
        }
        II::ImplItem(d, ii) => {
            II::ImplItem(fld.fold_ops.new_def_id(d),
                         ii.map(|ii| fld.fold_impl_item(ii)))
        }
        II::Foreign(i) => II::Foreign(i.map(|i| fld.fold_foreign_item(i)))
    };
    let ii = map.forest.inlined_items.alloc(ii);
    let ii_parent_id = fld.new_id(DUMMY_NODE_ID);
    let defs = &mut *map.definitions.borrow_mut();
    let mut def_collector = DefCollector::extend(ii_parent_id,
                                                 parent_def_path.clone(),
                                                 parent_def_id,
                                                 defs);
    def_collector.walk_item(ii, map.krate());
    let mut collector = NodeCollector::extend(map.krate(),
                                              ii,
                                              ii_parent_id,
                                              parent_def_path,
                                              parent_def_id,
                                              mem::replace(&mut *map.map.borrow_mut(), vec![]));
    ii.visit(&mut collector);
    *map.map.borrow_mut() = collector.map;
    ii
}
pub fn map_decoded_item < ' ast , F : FoldOps > ( map : & Map < ' ast > , parent_def_path : DefPath , parent_def_id : DefId , ii : InlinedItem , fold_ops : F ) -> & ' ast InlinedItem { let mut fld = IdAndSpanUpdater { fold_ops : fold_ops } ; let ii = match ii { II :: Item ( i ) => II :: Item ( i . map ( | i | fld . fold_item ( i ) ) ) , II :: TraitItem ( d , ti ) => { II :: TraitItem ( fld . fold_ops . new_def_id ( d ) , ti . map ( | ti | fld . fold_trait_item ( ti ) ) ) } II :: ImplItem ( d , ii ) => { II :: ImplItem ( fld . fold_ops . new_def_id ( d ) , ii . map ( | ii | fld . fold_impl_item ( ii ) ) ) } II :: Foreign ( i ) => II :: Foreign ( i . map ( | i | fld . fold_foreign_item ( i ) ) ) } ; let ii = map . forest . inlined_items . alloc ( ii ) ; let ii_parent_id = fld . new_id ( DUMMY_NODE_ID ) ; let defs = & mut * map . definitions . borrow_mut ( ) ; let mut def_collector = DefCollector :: extend ( ii_parent_id , parent_def_path . clone ( ) , parent_def_id , defs ) ; def_collector . walk_item ( ii , map . krate ( ) ) ; let mut collector = NodeCollector :: extend ( map . krate ( ) , ii , ii_parent_id , parent_def_path , parent_def_id , mem :: replace ( & mut * map . map . borrow_mut ( ) , vec ! [ ] ) ) ; ii . visit ( & mut collector ) ; * map . map . borrow_mut ( ) = collector . map ; ii }
Used for items loaded from external crate that are being inlined into this
crate.
Used for items loaded from external crate that are being inlined into this crate .
map
&Map<'ast>
parent_def_path
DefPath
parent_def_id
DefId
ii
InlinedItem
fold_ops
F
map
&Map<'ast>
parent_def_path
DefPath
parent_def_id
DefId
ii
InlinedItem
fold_ops
F