@@ -10,7 +10,7 @@ use rustc_data_structures::sync::Lrc;
10
10
use rustc_hir as hir;
11
11
use rustc_hir:: def:: { DefKind , Res } ;
12
12
use rustc_hir:: def_id:: LOCAL_CRATE ;
13
- use rustc_hir:: def_id:: { CrateNum , DefId } ;
13
+ use rustc_hir:: def_id:: { CrateNum , DefId , LocalDefId } ;
14
14
use rustc_hir:: intravisit:: { self , NestedVisitorMap , Visitor } ;
15
15
use rustc_hir:: itemlikevisit:: ItemLikeVisitor ;
16
16
use rustc_hir:: { HirIdSet , Node } ;
@@ -42,7 +42,7 @@ fn item_might_be_inlined(tcx: TyCtxt<'tcx>, item: &hir::Item<'_>, attrs: Codegen
42
42
fn method_might_be_inlined (
43
43
tcx : TyCtxt < ' _ > ,
44
44
impl_item : & hir:: ImplItem < ' _ > ,
45
- impl_src : DefId ,
45
+ impl_src : LocalDefId ,
46
46
) -> bool {
47
47
let codegen_fn_attrs = tcx. codegen_fn_attrs ( impl_item. hir_id . owner . to_def_id ( ) ) ;
48
48
let generics = tcx. generics_of ( tcx. hir ( ) . local_def_id ( impl_item. hir_id ) ) ;
@@ -54,7 +54,7 @@ fn method_might_be_inlined(
54
54
return true ;
55
55
}
56
56
}
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 ( ) ) {
58
58
match tcx. hir ( ) . find ( impl_hir_id) {
59
59
Some ( Node :: Item ( item) ) => item_might_be_inlined ( tcx, & item, codegen_fn_attrs) ,
60
60
Some ( ..) | None => span_bug ! ( impl_item. span, "impl did is not an item" ) ,
@@ -171,7 +171,7 @@ impl<'a, 'tcx> ReachableContext<'a, 'tcx> {
171
171
if generics. requires_monomorphization ( self . tcx ) || attrs. requests_inline ( ) {
172
172
true
173
173
} 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 ( ) ;
175
175
// Check the impl. If the generics on the self
176
176
// type of the impl require inlining, this method
177
177
// does too.
0 commit comments