fn resolve_type(cx: &DocContext,
                path: Path,
                id: ast::NodeId) -> Type {
    debug!("resolve_type({:?},{:?})", path, id);

    let is_generic = match path.def {
        Def::PrimTy(p) => match p {
            hir::TyStr => return Primitive(PrimitiveType::Str),
            hir::TyBool => return Primitive(PrimitiveType::Bool),
            hir::TyChar => return Primitive(PrimitiveType::Char),
            hir::TyInt(int_ty) => return Primitive(int_ty.into()),
            hir::TyUint(uint_ty) => return Primitive(uint_ty.into()),
            hir::TyFloat(float_ty) => return Primitive(float_ty.into()),
        },
        Def::SelfTy(..) if path.segments.len() == 1 => {
            return Generic(keywords::SelfType.name().to_string());
        }
        Def::SelfTy(..) | Def::TyParam(..) | Def::AssociatedTy(..) => true,
        _ => false,
    };
    let did = register_def(&*cx, path.def);
    ResolvedPath { path: path, typarams: None, did: did, is_generic: is_generic }
}
/// Given a type Path, resolve it to a Type using the TyCtxt
Given a type Path, resolve it to a Type using the TyCtxt
Given a type Path resolve it to a Type using the TyCtxt
fn resolve_type(cx: &DocContext,
                path: Path,
                id: ast::NodeId) -> Type {
    debug!("resolve_type({:?},{:?})", path, id);
    let is_generic = match path.def {
        Def::PrimTy(p) => match p {
            hir::TyStr => return Primitive(PrimitiveType::Str),
            hir::TyBool => return Primitive(PrimitiveType::Bool),
            hir::TyChar => return Primitive(PrimitiveType::Char),
            hir::TyInt(int_ty) => return Primitive(int_ty.into()),
            hir::TyUint(uint_ty) => return Primitive(uint_ty.into()),
            hir::TyFloat(float_ty) => return Primitive(float_ty.into()),
        },
        Def::SelfTy(..) if path.segments.len() == 1 => {
            return Generic(keywords::SelfType.name().to_string());
        }
        Def::SelfTy(..) | Def::TyParam(..) | Def::AssociatedTy(..) => true,
        _ => false,
    };
    let did = register_def(&*cx, path.def);
    ResolvedPath { path: path, typarams: None, did: did, is_generic: is_generic }
}
fn resolve_type ( cx : & DocContext , path : Path , id : ast :: NodeId ) -> Type { debug ! ( " " path id ) ; let is_generic = match path . def { Def :: PrimTy ( p ) => match p { hir :: TyStr => return Primitive ( PrimitiveType :: Str ) , hir :: TyBool => return Primitive ( PrimitiveType :: Bool ) , hir :: TyChar => return Primitive ( PrimitiveType :: Char ) , hir :: TyInt ( int_ty ) => return Primitive ( int_ty . into ( ) ) , hir :: TyUint ( uint_ty ) => return Primitive ( uint_ty . into ( ) ) , hir :: TyFloat ( float_ty ) => return Primitive ( float_ty . into ( ) ) , } , Def :: SelfTy ( .. ) if path . segments . len ( ) == 1 => { return Generic ( keywords :: SelfType . name ( ) . to_string ( ) ) ; } Def :: SelfTy ( .. ) | Def :: TyParam ( .. ) | Def :: AssociatedTy ( .. ) => true , _ => false , } ; let did = register_def ( & * cx , path . def ) ; ResolvedPath { path : path , typarams : None , did : did , is_generic : is_generic } }
Given a type Path, resolve it to a Type using the TyCtxt
Given a type Path resolve it to a Type using the TyCtxt
cx
&DocContext
path
Path
id
ast::NodeId