1
Fork 0

Use ItemCtxt::to_ty

This commit is contained in:
Cameron Steffen 2021-02-09 19:05:18 -06:00
parent 0fc6756b42
commit 471ed5f80f
2 changed files with 2 additions and 3 deletions

View file

@ -278,7 +278,7 @@ impl ItemCtxt<'tcx> {
ItemCtxt { tcx, item_def_id }
}
pub fn to_ty(&self, ast_ty: &'tcx hir::Ty<'tcx>) -> Ty<'tcx> {
pub fn to_ty(&self, ast_ty: &hir::Ty<'_>) -> Ty<'tcx> {
AstConv::ast_ty_to_ty(self, ast_ty)
}

View file

@ -421,8 +421,7 @@ pub fn hir_ty_to_ty<'tcx>(tcx: TyCtxt<'tcx>, hir_ty: &hir::Ty<'_>) -> Ty<'tcx> {
let env_node_id = tcx.hir().get_parent_item(hir_ty.hir_id);
let env_def_id = tcx.hir().local_def_id(env_node_id);
let item_cx = self::collect::ItemCtxt::new(tcx, env_def_id.to_def_id());
astconv::AstConv::ast_ty_to_ty(&item_cx, hir_ty)
item_cx.to_ty(hir_ty)
}
pub fn hir_trait_to_predicates<'tcx>(