fn convert_def_id(&mut self,
                      dcx: &DecodeContext,
                      source: tydecode::DefIdSource,
                      did: ast::DefId)
                      -> ast::DefId {
        let r = match source {
            NominalType | TypeWithId | RegionParameter => dcx.tr_def_id(did),
            TypeParameter | ClosureSource => dcx.tr_intern_def_id(did)
        };
        debug!("convert_def_id(source={:?}, did={:?})={:?}", source, did, r);
        return r;
    }
/// Converts a def-id that appears in a type.  The correct
/// translation will depend on what kind of def-id this is.
/// This is a subtle point: type definitions are not
/// inlined into the current crate, so if the def-id names
/// a nominal type or type alias, then it should be
/// translated to refer to the source crate.
///
/// However, *type parameters* are cloned along with the function
/// they are attached to.  So we should translate those def-ids
/// to refer to the new, cloned copy of the type parameter.
/// We only see references to free type parameters in the body of
/// an inlined function. In such cases, we need the def-id to
/// be a local id so that the TypeContents code is able to lookup
/// the relevant info in the ty_param_defs table.
///
/// *Region parameters*, unfortunately, are another kettle of fish.
/// In such cases, def_id's can appear in types to distinguish
/// shadowed bound regions and so forth. It doesn't actually
/// matter so much what we do to these, since regions are erased
/// at trans time, but it's good to keep them consistent just in
/// case. We translate them with `tr_def_id()` which will map
/// the crate numbers back to the original source crate.
///
/// Unboxed closures are cloned along with the function being
/// inlined, and all side tables use interned node IDs, so we
/// translate their def IDs accordingly.
///
/// It'd be really nice to refactor the type repr to not include
/// def-ids so that all these distinctions were unnecessary.
Converts a def-id that appears in a type.  The correct
translation will depend on what kind of def-id this is.
This is a subtle point: type definitions are not
inlined into the current crate, so if the def-id names
a nominal type or type alias, then it should be
translated to refer to the source crate.

However, *type parameters* are cloned along with the function
they are attached to.  So we should translate those def-ids
to refer to the new, cloned copy of the type parameter.
We only see references to free type parameters in the body of
an inlined function. In such cases, we need the def-id to
be a local id so that the TypeContents code is able to lookup
the relevant info in the ty_param_defs table.

Region parameters*, unfortunately, are another kettle of fish.
In such cases, def_id's can appear in types to distinguish
shadowed bound regions and so forth. It doesn't actually
matter so much what we do to these, since regions are erased
at trans time, but it's good to keep them consistent just in
case. We translate them with `tr_def_id()` which will map
the crate numbers back to the original source crate.

Unboxed closures are cloned along with the function being
inlined, and all side tables use interned node IDs, so we
translate their def IDs accordingly.

It'd be really nice to refactor the type repr to not include
def-ids so that all these distinctions were unnecessary.
Converts a def - id that appears in a type . The correct translation will depend on what kind of def - id this is . This is a subtle point : type definitions are not inlined into the current crate so if the def - id names a nominal type or type alias then it should be translated to refer to the source crate . However * type parameters * are cloned along with the function they are attached to . So we should translate those def - ids to refer to the new cloned copy of the type parameter . We only see references to free type parameters in the body of an inlined function . In such cases we need the def - id to be a local id so that the TypeContents code is able to lookup the relevant info in the ty_param_defs table . Region parameters * unfortunately are another kettle of fish . In such cases def_id ' s can appear in types to distinguish shadowed bound regions and so forth . It doesn ' t actually matter so much what we do to these since regions are erased at trans time but it ' s good to keep them consistent just in case . We translate them with ` tr_def_id () ` which will map the crate numbers back to the original source crate . Unboxed closures are cloned along with the function being inlined and all side tables use interned node IDs so we translate their def IDs accordingly . It ' d be really nice to refactor the type repr to not include def - ids so that all these distinctions were unnecessary .
fn convert_def_id(&mut self,
                      dcx: &DecodeContext,
                      source: tydecode::DefIdSource,
                      did: ast::DefId)
                      -> ast::DefId {
        let r = match source {
            NominalType | TypeWithId | RegionParameter => dcx.tr_def_id(did),
            TypeParameter | ClosureSource => dcx.tr_intern_def_id(did)
        };
        debug!("convert_def_id(source={:?}, did={:?})={:?}", source, did, r);
        return r;
    }
fn convert_def_id ( & mut self , dcx : & DecodeContext , source : tydecode :: DefIdSource , did : ast :: DefId ) -> ast :: DefId { let r = match source { NominalType | TypeWithId | RegionParameter => dcx . tr_def_id ( did ) , TypeParameter | ClosureSource => dcx . tr_intern_def_id ( did ) } ; debug ! ( " " source did r ) ; return r ; }
Converts a def-id that appears in a type.
Converts a def - id that appears in a type .
&mut self
dcx
&DecodeContext
source
tydecode::DefIdSource
did
ast::DefId