File tree 2 files changed +2
-4
lines changed
rustc_mir_build/src/thir/cx
2 files changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -92,8 +92,7 @@ impl<'tcx> Const<'tcx> {
92
92
let item_id = tcx. hir ( ) . get_parent_node ( hir_id) ;
93
93
let item_def_id = tcx. hir ( ) . local_def_id ( item_id) ;
94
94
let generics = tcx. generics_of ( item_def_id. to_def_id ( ) ) ;
95
- let index =
96
- generics. param_def_id_to_index [ & tcx. hir ( ) . local_def_id ( hir_id) . to_def_id ( ) ] ;
95
+ let index = generics. param_def_id_to_index [ & def_id] ;
97
96
let name = tcx. hir ( ) . name ( hir_id) ;
98
97
ty:: ConstKind :: Param ( ty:: ParamConst :: new ( index, name) )
99
98
}
Original file line number Diff line number Diff line change @@ -813,8 +813,7 @@ fn convert_path_expr<'a, 'tcx>(
813
813
let item_id = cx. tcx . hir ( ) . get_parent_node ( hir_id) ;
814
814
let item_def_id = cx. tcx . hir ( ) . local_def_id ( item_id) ;
815
815
let generics = cx. tcx . generics_of ( item_def_id) ;
816
- let local_def_id = cx. tcx . hir ( ) . local_def_id ( hir_id) ;
817
- let index = generics. param_def_id_to_index [ & local_def_id. to_def_id ( ) ] ;
816
+ let index = generics. param_def_id_to_index [ & def_id] ;
818
817
let name = cx. tcx . hir ( ) . name ( hir_id) ;
819
818
let val = ty:: ConstKind :: Param ( ty:: ParamConst :: new ( index, name) ) ;
820
819
ExprKind :: Literal {
You can’t perform that action at this time.
0 commit comments