@@ -274,7 +274,7 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::EarlyBinder<Ty
274274 let output = match tcx. hir ( ) . get ( hir_id) {
275275 Node :: TraitItem ( item) => match item. kind {
276276 TraitItemKind :: Fn ( ..) => {
277- let substs = InternalSubsts :: identity_for_item ( tcx, def_id. to_def_id ( ) ) ;
277+ let substs = InternalSubsts :: identity_for_item ( tcx, def_id) ;
278278 tcx. mk_fn_def ( def_id. to_def_id ( ) , substs)
279279 }
280280 TraitItemKind :: Const ( ty, body_id) => body_id
@@ -294,7 +294,7 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::EarlyBinder<Ty
294294
295295 Node :: ImplItem ( item) => match item. kind {
296296 ImplItemKind :: Fn ( ..) => {
297- let substs = InternalSubsts :: identity_for_item ( tcx, def_id. to_def_id ( ) ) ;
297+ let substs = InternalSubsts :: identity_for_item ( tcx, def_id) ;
298298 tcx. mk_fn_def ( def_id. to_def_id ( ) , substs)
299299 }
300300 ImplItemKind :: Const ( ty, body_id) => {
@@ -350,12 +350,12 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::EarlyBinder<Ty
350350 _ => icx. to_ty ( * self_ty) ,
351351 } ,
352352 ItemKind :: Fn ( ..) => {
353- let substs = InternalSubsts :: identity_for_item ( tcx, def_id. to_def_id ( ) ) ;
353+ let substs = InternalSubsts :: identity_for_item ( tcx, def_id) ;
354354 tcx. mk_fn_def ( def_id. to_def_id ( ) , substs)
355355 }
356356 ItemKind :: Enum ( ..) | ItemKind :: Struct ( ..) | ItemKind :: Union ( ..) => {
357357 let def = tcx. adt_def ( def_id) ;
358- let substs = InternalSubsts :: identity_for_item ( tcx, def_id. to_def_id ( ) ) ;
358+ let substs = InternalSubsts :: identity_for_item ( tcx, def_id) ;
359359 tcx. mk_adt ( def, substs)
360360 }
361361 ItemKind :: OpaqueTy ( OpaqueTy { origin : hir:: OpaqueTyOrigin :: TyAlias , .. } ) => {
@@ -395,7 +395,7 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::EarlyBinder<Ty
395395
396396 Node :: ForeignItem ( foreign_item) => match foreign_item. kind {
397397 ForeignItemKind :: Fn ( ..) => {
398- let substs = InternalSubsts :: identity_for_item ( tcx, def_id. to_def_id ( ) ) ;
398+ let substs = InternalSubsts :: identity_for_item ( tcx, def_id) ;
399399 tcx. mk_fn_def ( def_id. to_def_id ( ) , substs)
400400 }
401401 ForeignItemKind :: Static ( t, _) => icx. to_ty ( t) ,
@@ -407,7 +407,7 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::EarlyBinder<Ty
407407 tcx. type_of ( tcx. hir ( ) . get_parent_item ( hir_id) ) . subst_identity ( )
408408 }
409409 VariantData :: Tuple ( ..) => {
410- let substs = InternalSubsts :: identity_for_item ( tcx, def_id. to_def_id ( ) ) ;
410+ let substs = InternalSubsts :: identity_for_item ( tcx, def_id) ;
411411 tcx. mk_fn_def ( def_id. to_def_id ( ) , substs)
412412 }
413413 } ,
@@ -440,7 +440,7 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::EarlyBinder<Ty
440440 Node :: Expr ( Expr { kind : ExprKind :: ConstBlock ( anon_const) , .. } )
441441 if anon_const. hir_id == hir_id =>
442442 {
443- let substs = InternalSubsts :: identity_for_item ( tcx, def_id. to_def_id ( ) ) ;
443+ let substs = InternalSubsts :: identity_for_item ( tcx, def_id) ;
444444 substs. as_inline_const ( ) . ty ( )
445445 }
446446
0 commit comments