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:
parent
1ad1b7d947
commit
e184c2daf1
1 changed files with 2 additions and 0 deletions
|
@ -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)
|
pub fn ast_ty_to_prim_ty<'tcx>(tcx: &ty::ctxt<'tcx>, ast_ty: &ast::Ty)
|
||||||
-> Option<Ty<'tcx>> {
|
-> Option<Ty<'tcx>> {
|
||||||
if let ast::TyPath(None, ref path) = ast_ty.node {
|
if let ast::TyPath(None, ref path) = ast_ty.node {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue