]> git.lizzy.rs Git - rust.git/commitdiff
Use ItemCtxt::to_ty
authorCameron Steffen <cam.steffen94@gmail.com>
Wed, 10 Feb 2021 01:05:18 +0000 (19:05 -0600)
committerCameron Steffen <cam.steffen94@gmail.com>
Wed, 10 Feb 2021 01:27:33 +0000 (19:27 -0600)
compiler/rustc_typeck/src/collect.rs
compiler/rustc_typeck/src/lib.rs

index b1d98d75196d5be4b3cc351839fda86c5ad5c31b..2c1e07fb7003d8d0de639680082dc16a3cd0b2b7 100644 (file)
@@ -278,7 +278,7 @@ pub fn new(tcx: TyCtxt<'tcx>, item_def_id: DefId) -> 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)
     }
 
index fd44bafab6f76ea19abb763bd0a474d0c778cad7..542fa1a5acce0737a94f8cb6d446a3af3353a2c7 100644 (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>(