Add docs for ast_ty_to_prim_ty

Confusion about what this does caused a bug in Servo's lints.
This commit is contained in:
Manish Goregaokar 2015-10-15 18:57:24 +05:30
parent 1ad1b7d947
commit e184c2daf1

View file

@ -60,6 +60,8 @@ pub fn prim_ty_to_ty<'tcx>(tcx: &ty::ctxt<'tcx>,
}
}
/// If a type in the AST is a primitive type, return the ty::Ty corresponding
/// to it.
pub fn ast_ty_to_prim_ty<'tcx>(tcx: &ty::ctxt<'tcx>, ast_ty: &ast::Ty)
-> Option<Ty<'tcx>> {
if let ast::TyPath(None, ref path) = ast_ty.node {