about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev@gmail.com>2021-02-12 19:32:08 +0900
committerGitHub <noreply@github.com>2021-02-12 19:32:08 +0900
commitc07260d534dcdfe0e45db5b928c4a27bdd4c0ef7 (patch)
tree98d3d404c20e087838c6275eb8eb88007662ee6a
parent327762f0885c1c291e8f8dda671e1efd2b7030d6 (diff)
parent471ed5f80fd1a53a26dc8ca750910f75ed744795 (diff)
downloadrust-c07260d534dcdfe0e45db5b928c4a27bdd4c0ef7.tar.gz
rust-c07260d534dcdfe0e45db5b928c4a27bdd4c0ef7.zip
Rollup merge of #81947 - camsteffen:to-ty, r=jyn514
Relax ItemCtxt::to_ty lifetime

Tiny simplification by relaxing a lifetime.
-rw-r--r--compiler/rustc_typeck/src/collect.rs2
-rw-r--r--compiler/rustc_typeck/src/lib.rs3
2 files changed, 2 insertions, 3 deletions
diff --git a/compiler/rustc_typeck/src/collect.rs b/compiler/rustc_typeck/src/collect.rs
index e5045f906df..66d158b0ee9 100644
--- a/compiler/rustc_typeck/src/collect.rs
+++ b/compiler/rustc_typeck/src/collect.rs
@@ -280,7 +280,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)
     }
 
diff --git a/compiler/rustc_typeck/src/lib.rs b/compiler/rustc_typeck/src/lib.rs
index fd44bafab6f..542fa1a5acc 100644
--- a/compiler/rustc_typeck/src/lib.rs
+++ b/compiler/rustc_typeck/src/lib.rs
@@ -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>(