pub fn translate_def_id(cdata: Cmd, did: DefId) -> DefId {
    if did.is_local() {
        return DefId { krate: cdata.cnum, node: did.node };
    }

    match cdata.cnum_map.borrow().get(&did.krate) {
        Some(&n) => {
            DefId {
                krate: n,
                node: did.node,
            }
        }
        None => panic!("didn't find a crate in the cnum_map")
    }
}
// Translates a def_id from an external crate to a def_id for the current
// compilation environment. We use this when trying to load types from
// external crates - if those types further refer to types in other crates
// then we must translate the crate number from that encoded in the external
// crate to the correct local crate number.
Translates a def_id from an external crate to a def_id for the current
compilation environment. We use this when trying to load types from
external crates - if those types further refer to types in other crates
then we must translate the crate number from that encoded in the external
crate to the correct local crate number.
Translates a def_id from an external crate to a def_id for the current compilation environment . We use this when trying to load types from external crates - if those types further refer to types in other crates then we must translate the crate number from that encoded in the external crate to the correct local crate number .
pub fn translate_def_id(cdata: Cmd, did: DefId) -> DefId {
    if did.is_local() {
        return DefId { krate: cdata.cnum, node: did.node };
    }
    match cdata.cnum_map.borrow().get(&did.krate) {
        Some(&n) => {
            DefId {
                krate: n,
                node: did.node,
            }
        }
        None => panic!("didn't find a crate in the cnum_map")
    }
}
pub fn translate_def_id ( cdata : Cmd , did : DefId ) -> DefId { if did . is_local ( ) { return DefId { krate : cdata . cnum , node : did . node } ; } match cdata . cnum_map . borrow ( ) . get ( & did . krate ) { Some ( & n ) => { DefId { krate : n , node : did . node , } } None => panic ! ( " " ) } }
Translates a def_id from an external crate to a def_id for the current
compilation environment.
Translates a def_id from an external crate to a def_id for the current compilation environment .
cdata
Cmd
did
DefId
cdata
Cmd
did
DefId