@@ -10,7 +10,7 @@ use rustc_data_structures::sync::Lrc;
1010use rustc_hir as hir;
1111use rustc_hir:: def:: { DefKind , Res } ;
1212use rustc_hir:: def_id:: LOCAL_CRATE ;
13- use rustc_hir:: def_id:: { CrateNum , DefId } ;
13+ use rustc_hir:: def_id:: { CrateNum , DefId , LocalDefId } ;
1414use rustc_hir:: intravisit:: { self , NestedVisitorMap , Visitor } ;
1515use rustc_hir:: itemlikevisit:: ItemLikeVisitor ;
1616use rustc_hir:: { HirIdSet , Node } ;
@@ -42,7 +42,7 @@ fn item_might_be_inlined(tcx: TyCtxt<'tcx>, item: &hir::Item<'_>, attrs: Codegen
4242fn method_might_be_inlined (
4343 tcx : TyCtxt < ' _ > ,
4444 impl_item : & hir:: ImplItem < ' _ > ,
45- impl_src : DefId ,
45+ impl_src : LocalDefId ,
4646) -> bool {
4747 let codegen_fn_attrs = tcx. codegen_fn_attrs ( impl_item. hir_id . owner . to_def_id ( ) ) ;
4848 let generics = tcx. generics_of ( tcx. hir ( ) . local_def_id ( impl_item. hir_id ) ) ;
@@ -54,7 +54,7 @@ fn method_might_be_inlined(
5454 return true ;
5555 }
5656 }
57- if let Some ( impl_hir_id) = tcx. hir ( ) . as_local_hir_id ( impl_src) {
57+ if let Some ( impl_hir_id) = tcx. hir ( ) . as_local_hir_id ( impl_src. to_def_id ( ) ) {
5858 match tcx. hir ( ) . find ( impl_hir_id) {
5959 Some ( Node :: Item ( item) ) => item_might_be_inlined ( tcx, & item, codegen_fn_attrs) ,
6060 Some ( ..) | None => span_bug ! ( impl_item. span, "impl did is not an item" ) ,
@@ -171,7 +171,7 @@ impl<'a, 'tcx> ReachableContext<'a, 'tcx> {
171171 if generics. requires_monomorphization ( self . tcx ) || attrs. requests_inline ( ) {
172172 true
173173 } else {
174- let impl_did = self . tcx . hir ( ) . get_parent_did ( hir_id) ;
174+ let impl_did = self . tcx . hir ( ) . get_parent_did ( hir_id) . to_def_id ( ) ;
175175 // Check the impl. If the generics on the self
176176 // type of the impl require inlining, this method
177177 // does too.
0 commit comments