@@ -274,7 +274,7 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::EarlyBinder<Ty
274
274
let output = match tcx. hir ( ) . get ( hir_id) {
275
275
Node :: TraitItem ( item) => match item. kind {
276
276
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) ;
278
278
tcx. mk_fn_def ( def_id. to_def_id ( ) , substs)
279
279
}
280
280
TraitItemKind :: Const ( ty, body_id) => body_id
@@ -294,7 +294,7 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::EarlyBinder<Ty
294
294
295
295
Node :: ImplItem ( item) => match item. kind {
296
296
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) ;
298
298
tcx. mk_fn_def ( def_id. to_def_id ( ) , substs)
299
299
}
300
300
ImplItemKind :: Const ( ty, body_id) => {
@@ -350,12 +350,12 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::EarlyBinder<Ty
350
350
_ => icx. to_ty ( * self_ty) ,
351
351
} ,
352
352
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) ;
354
354
tcx. mk_fn_def ( def_id. to_def_id ( ) , substs)
355
355
}
356
356
ItemKind :: Enum ( ..) | ItemKind :: Struct ( ..) | ItemKind :: Union ( ..) => {
357
357
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) ;
359
359
tcx. mk_adt ( def, substs)
360
360
}
361
361
ItemKind :: OpaqueTy ( OpaqueTy { origin : hir:: OpaqueTyOrigin :: TyAlias , .. } ) => {
@@ -395,7 +395,7 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::EarlyBinder<Ty
395
395
396
396
Node :: ForeignItem ( foreign_item) => match foreign_item. kind {
397
397
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) ;
399
399
tcx. mk_fn_def ( def_id. to_def_id ( ) , substs)
400
400
}
401
401
ForeignItemKind :: Static ( t, _) => icx. to_ty ( t) ,
@@ -407,7 +407,7 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::EarlyBinder<Ty
407
407
tcx. type_of ( tcx. hir ( ) . get_parent_item ( hir_id) ) . subst_identity ( )
408
408
}
409
409
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) ;
411
411
tcx. mk_fn_def ( def_id. to_def_id ( ) , substs)
412
412
}
413
413
} ,
@@ -440,7 +440,7 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> ty::EarlyBinder<Ty
440
440
Node :: Expr ( Expr { kind : ExprKind :: ConstBlock ( anon_const) , .. } )
441
441
if anon_const. hir_id == hir_id =>
442
442
{
443
- let substs = InternalSubsts :: identity_for_item ( tcx, def_id. to_def_id ( ) ) ;
443
+ let substs = InternalSubsts :: identity_for_item ( tcx, def_id) ;
444
444
substs. as_inline_const ( ) . ty ( )
445
445
}
446
446
0 commit comments