Skip to content

Commit 2c9ca55

Browse files
authored
Rollup merge of rust-lang#81947 - camsteffen:to-ty, r=jyn514
Relax ItemCtxt::to_ty lifetime Tiny simplification by relaxing a lifetime.
2 parents 4ece99b + 471ed5f commit 2c9ca55

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

compiler/rustc_typeck/src/collect.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ impl ItemCtxt<'tcx> {
280280
ItemCtxt { tcx, item_def_id }
281281
}
282282

283-
pub fn to_ty(&self, ast_ty: &'tcx hir::Ty<'tcx>) -> Ty<'tcx> {
283+
pub fn to_ty(&self, ast_ty: &hir::Ty<'_>) -> Ty<'tcx> {
284284
AstConv::ast_ty_to_ty(self, ast_ty)
285285
}
286286

compiler/rustc_typeck/src/lib.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -421,8 +421,7 @@ pub fn hir_ty_to_ty<'tcx>(tcx: TyCtxt<'tcx>, hir_ty: &hir::Ty<'_>) -> Ty<'tcx> {
421421
let env_node_id = tcx.hir().get_parent_item(hir_ty.hir_id);
422422
let env_def_id = tcx.hir().local_def_id(env_node_id);
423423
let item_cx = self::collect::ItemCtxt::new(tcx, env_def_id.to_def_id());
424-
425-
astconv::AstConv::ast_ty_to_ty(&item_cx, hir_ty)
424+
item_cx.to_ty(hir_ty)
426425
}
427426

428427
pub fn hir_trait_to_predicates<'tcx>(

0 commit comments

Comments
 (0)