File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
compiler/rustc_typeck/src/astconv Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -221,9 +221,12 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
221
221
tcx. mk_region ( ty:: ReLateBound ( debruijn, br) )
222
222
}
223
223
224
- Some ( rl:: Region :: EarlyBound ( index, id) ) => {
225
- let name = lifetime_name ( id. expect_local ( ) ) ;
226
- tcx. mk_region ( ty:: ReEarlyBound ( ty:: EarlyBoundRegion { def_id : id, index, name } ) )
224
+ Some ( rl:: Region :: EarlyBound ( _, def_id) ) => {
225
+ let name = tcx. hir ( ) . ty_param_name ( def_id. expect_local ( ) ) ;
226
+ let item_def_id = tcx. hir ( ) . ty_param_owner ( def_id. expect_local ( ) ) ;
227
+ let generics = tcx. generics_of ( item_def_id) ;
228
+ let index = generics. param_def_id_to_index [ & def_id] ;
229
+ tcx. mk_region ( ty:: ReEarlyBound ( ty:: EarlyBoundRegion { def_id, index, name } ) )
227
230
}
228
231
229
232
Some ( rl:: Region :: Free ( scope, id) ) => {
You can’t perform that action at this time.
0 commit comments