/// If a type in the AST is a primitive type, return the ty::Ty corresponding
/// to it.
If a type in the AST is a primitive type, return the ty::Ty corresponding
to it.
If a type in the AST is a primitive type return the ty :: Ty corresponding to it .
pub fn ast_ty_to_prim_ty(self, ast_ty: &ast::Ty) -> Option<Ty<'tcx>> {
        if let ast::TyPath(None, ref path) = ast_ty.node {
            if let Def::PrimTy(nty) = self.expect_def(ast_ty.id) {
                Some(self.prim_ty_to_ty(&path.segments, nty))
            } else {
                None
            }
        } else {
            None
        }
    }
pub fn ast_ty_to_prim_ty ( self , ast_ty : & ast :: Ty ) -> Option < Ty < ' tcx > > { if let ast :: TyPath ( None , ref path ) = ast_ty . node { if let Def :: PrimTy ( nty ) = self . expect_def ( ast_ty . id ) { Some ( self . prim_ty_to_ty ( & path . segments , nty ) ) } else { None } } else { None } }
If a type in the AST is a primitive type, return the ty::Ty corresponding
to it.
If a type in the AST is a primitive type return the ty :: Ty corresponding to it .
self
ast_ty
&ast::Ty