@@ -96,7 +96,7 @@ fn reachable_non_generics_provider(
9696 if !generics. requires_monomorphization ( tcx) &&
9797 // Functions marked with #[inline] are only ever codegened
9898 // with "internal" linkage and are never exported.
99- !Instance :: mono ( tcx, def_id) . def . generates_cgu_internal_copy ( tcx)
99+ !Instance :: mono ( tcx, def_id. to_def_id ( ) ) . def . generates_cgu_internal_copy ( tcx)
100100 {
101101 Some ( def_id)
102102 } else {
@@ -109,7 +109,7 @@ fn reachable_non_generics_provider(
109109 } )
110110 . map ( |def_id| {
111111 let export_level = if special_runtime_crate {
112- let name = tcx. symbol_name ( Instance :: mono ( tcx, def_id) ) . name . as_str ( ) ;
112+ let name = tcx. symbol_name ( Instance :: mono ( tcx, def_id. to_def_id ( ) ) ) . name . as_str ( ) ;
113113 // We can probably do better here by just ensuring that
114114 // it has hidden visibility rather than public
115115 // visibility, as this is primarily here to ensure it's
@@ -126,14 +126,14 @@ fn reachable_non_generics_provider(
126126 SymbolExportLevel :: Rust
127127 }
128128 } else {
129- symbol_export_level ( tcx, def_id)
129+ symbol_export_level ( tcx, def_id. to_def_id ( ) )
130130 } ;
131131 debug ! (
132132 "EXPORTED SYMBOL (local): {} ({:?})" ,
133- tcx. symbol_name( Instance :: mono( tcx, def_id) ) ,
133+ tcx. symbol_name( Instance :: mono( tcx, def_id. to_def_id ( ) ) ) ,
134134 export_level
135135 ) ;
136- ( def_id, export_level)
136+ ( def_id. to_def_id ( ) , export_level)
137137 } )
138138 . collect ( ) ;
139139
@@ -361,8 +361,8 @@ fn upstream_drop_glue_for_provider<'tcx>(
361361}
362362
363363fn is_unreachable_local_definition_provider ( tcx : TyCtxt < ' _ > , def_id : DefId ) -> bool {
364- if let Some ( hir_id ) = tcx . hir ( ) . as_local_hir_id ( def_id ) {
365- !tcx. reachable_set ( LOCAL_CRATE ) . contains ( & hir_id )
364+ if let Some ( def_id ) = def_id . as_local ( ) {
365+ !tcx. reachable_set ( LOCAL_CRATE ) . contains ( & tcx . hir ( ) . as_local_hir_id ( def_id ) )
366366 } else {
367367 bug ! ( "is_unreachable_local_definition called with non-local DefId: {:?}" , def_id)
368368 }
0 commit comments