File tree 2 files changed +8
-4
lines changed
2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -410,8 +410,11 @@ impl<'tcx> TyCtxt<'tcx> {
410
410
}
411
411
let hir = self . hir ( ) ;
412
412
let mut note = true ;
413
- if let Some ( generics) = hir
414
- . as_local_hir_id ( generics. type_param ( p, self ) . def_id )
413
+ if let Some ( generics) = generics
414
+ . type_param ( p, self )
415
+ . def_id
416
+ . as_local ( )
417
+ . map ( |id| hir. as_local_hir_id ( id) )
415
418
. and_then ( |id| self . hir ( ) . find ( self . hir ( ) . get_parent_node ( id) ) )
416
419
. as_ref ( )
417
420
. and_then ( |node| node. generics ( ) )
Original file line number Diff line number Diff line change @@ -954,8 +954,9 @@ fn suggest_constraining_param(
954
954
let def_id = hir. body_owner_def_id ( hir:: BodyId { hir_id : body_id } ) ;
955
955
let generics = tcx. generics_of ( def_id) ;
956
956
let param_def_id = generics. type_param ( & p, tcx) . def_id ;
957
- if let Some ( generics) = hir
958
- . as_local_hir_id ( param_def_id)
957
+ if let Some ( generics) = param_def_id
958
+ . as_local ( )
959
+ . map ( |id| hir. as_local_hir_id ( id) )
959
960
. and_then ( |id| hir. find ( hir. get_parent_item ( id) ) )
960
961
. as_ref ( )
961
962
. and_then ( |node| node. generics ( ) )
You can’t perform that action at this time.
0 commit comments