Skip to content

Commit e184c2d

Browse files
committed
Add docs for ast_ty_to_prim_ty
Confusion about what this does caused a bug in Servo's lints.
1 parent 1ad1b7d commit e184c2d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/librustc/middle/astconv_util.rs

+2
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,8 @@ pub fn prim_ty_to_ty<'tcx>(tcx: &ty::ctxt<'tcx>,
6060
}
6161
}
6262

63+
/// If a type in the AST is a primitive type, return the ty::Ty corresponding
64+
/// to it.
6365
pub fn ast_ty_to_prim_ty<'tcx>(tcx: &ty::ctxt<'tcx>, ast_ty: &ast::Ty)
6466
-> Option<Ty<'tcx>> {
6567
if let ast::TyPath(None, ref path) = ast_ty.node {

0 commit comments

Comments
 (0)