From e184c2daf16f7d77ed82c673de0b0a6e3949e661 Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Thu, 15 Oct 2015 18:57:24 +0530 Subject: [PATCH] Add docs for `ast_ty_to_prim_ty` Confusion about what this does caused a bug in Servo's lints. --- src/librustc/middle/astconv_util.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/librustc/middle/astconv_util.rs b/src/librustc/middle/astconv_util.rs index 3b837277203..2bf749d93ce 100644 --- a/src/librustc/middle/astconv_util.rs +++ b/src/librustc/middle/astconv_util.rs @@ -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> { if let ast::TyPath(None, ref path) = ast_ty.node {