@@ -432,7 +432,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
432
432
ty:: Const :: from_opt_const_arg_anon_const (
433
433
tcx,
434
434
ty:: WithOptConstParam {
435
- did : tcx . hir ( ) . local_def_id ( ct. value . hir_id ) ,
435
+ did : ct. value . def_id ,
436
436
const_param_did : Some ( param. def_id ) ,
437
437
} ,
438
438
)
@@ -570,8 +570,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
570
570
ConvertedBindingKind :: Equality ( self . ast_ty_to_ty ( ty) . into ( ) )
571
571
}
572
572
hir:: Term :: Const ( ref c) => {
573
- let local_did = self . tcx ( ) . hir ( ) . local_def_id ( c. hir_id ) ;
574
- let c = Const :: from_anon_const ( self . tcx ( ) , local_did) ;
573
+ let c = Const :: from_anon_const ( self . tcx ( ) , c. def_id ) ;
575
574
ConvertedBindingKind :: Equality ( c. into ( ) )
576
575
}
577
576
} ,
@@ -2712,16 +2711,15 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
2712
2711
let length = match length {
2713
2712
& hir:: ArrayLen :: Infer ( _, span) => self . ct_infer ( tcx. types . usize , None , span) ,
2714
2713
hir:: ArrayLen :: Body ( constant) => {
2715
- let length_def_id = tcx. hir ( ) . local_def_id ( constant. hir_id ) ;
2716
- ty:: Const :: from_anon_const ( tcx, length_def_id)
2714
+ ty:: Const :: from_anon_const ( tcx, constant. def_id )
2717
2715
}
2718
2716
} ;
2719
2717
2720
2718
let array_ty = tcx. mk_ty ( ty:: Array ( self . ast_ty_to_ty ( ty) , length) ) ;
2721
2719
self . normalize_ty ( ast_ty. span , array_ty)
2722
2720
}
2723
2721
hir:: TyKind :: Typeof ( ref e) => {
2724
- let ty_erased = tcx. type_of ( tcx . hir ( ) . local_def_id ( e . hir_id ) ) ;
2722
+ let ty_erased = tcx. type_of ( e . def_id ) ;
2725
2723
let ty = tcx. fold_regions ( ty_erased, |r, _| {
2726
2724
if r. is_erased ( ) { tcx. lifetimes . re_static } else { r }
2727
2725
} ) ;
0 commit comments