@@ -295,7 +295,7 @@ impl AstConv<'tcx> for ItemCtxt<'tcx> {
295295 }
296296
297297 fn get_type_parameter_bounds ( & self , span : Span , def_id : DefId ) -> ty:: GenericPredicates < ' tcx > {
298- self . tcx . at ( span) . type_param_predicates ( ( self . item_def_id , def_id) )
298+ self . tcx . at ( span) . type_param_predicates ( ( self . item_def_id , def_id. expect_local ( ) ) )
299299 }
300300
301301 fn re_infer ( & self , _: Option < & ty:: GenericParamDef > , _: Span ) -> Option < ty:: Region < ' tcx > > {
@@ -478,19 +478,19 @@ fn get_new_lifetime_name<'tcx>(
478478/// `X: Foo` where `X` is the type parameter `def_id`.
479479fn type_param_predicates (
480480 tcx : TyCtxt < ' _ > ,
481- ( item_def_id, def_id) : ( DefId , DefId ) ,
481+ ( item_def_id, def_id) : ( DefId , LocalDefId ) ,
482482) -> ty:: GenericPredicates < ' _ > {
483483 use rustc_hir:: * ;
484484
485485 // In the AST, bounds can derive from two places. Either
486486 // written inline like `<T: Foo>` or in a where-clause like
487487 // `where T: Foo`.
488488
489- let param_id = tcx. hir ( ) . as_local_hir_id ( def_id. expect_local ( ) ) ;
489+ let param_id = tcx. hir ( ) . as_local_hir_id ( def_id) ;
490490 let param_owner = tcx. hir ( ) . ty_param_owner ( param_id) ;
491491 let param_owner_def_id = tcx. hir ( ) . local_def_id ( param_owner) ;
492492 let generics = tcx. generics_of ( param_owner_def_id) ;
493- let index = generics. param_def_id_to_index [ & def_id] ;
493+ let index = generics. param_def_id_to_index [ & def_id. to_def_id ( ) ] ;
494494 let ty = tcx. mk_ty_param ( index, tcx. hir ( ) . ty_param_name ( param_id) ) ;
495495
496496 // Don't look for bounds where the type parameter isn't in scope.
@@ -503,7 +503,7 @@ fn type_param_predicates(
503503 let mut result = parent
504504 . map ( |parent| {
505505 let icx = ItemCtxt :: new ( tcx, parent) ;
506- icx. get_type_parameter_bounds ( DUMMY_SP , def_id)
506+ icx. get_type_parameter_bounds ( DUMMY_SP , def_id. to_def_id ( ) )
507507 } )
508508 . unwrap_or_default ( ) ;
509509 let mut extend = None ;
0 commit comments