File tree Expand file tree Collapse file tree 2 files changed +2
-4
lines changed
rustc_mir_build/src/thir/cx Expand file tree Collapse file tree 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> {
9292 let item_id = tcx. hir ( ) . get_parent_node ( hir_id) ;
9393 let item_def_id = tcx. hir ( ) . local_def_id ( item_id) ;
9494 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] ;
9796 let name = tcx. hir ( ) . name ( hir_id) ;
9897 ty:: ConstKind :: Param ( ty:: ParamConst :: new ( index, name) )
9998 }
Original file line number Diff line number Diff line change @@ -813,8 +813,7 @@ fn convert_path_expr<'a, 'tcx>(
813813 let item_id = cx. tcx . hir ( ) . get_parent_node ( hir_id) ;
814814 let item_def_id = cx. tcx . hir ( ) . local_def_id ( item_id) ;
815815 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] ;
818817 let name = cx. tcx . hir ( ) . name ( hir_id) ;
819818 let val = ty:: ConstKind :: Param ( ty:: ParamConst :: new ( index, name) ) ;
820819 ExprKind :: Literal {
You can’t perform that action at this time.
0 commit comments