@@ -96,7 +96,7 @@ fn reachable_non_generics_provider(
96
96
if !generics. requires_monomorphization ( tcx) &&
97
97
// Functions marked with #[inline] are only ever codegened
98
98
// 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)
100
100
{
101
101
Some ( def_id)
102
102
} else {
@@ -109,7 +109,7 @@ fn reachable_non_generics_provider(
109
109
} )
110
110
. map ( |def_id| {
111
111
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 ( ) ;
113
113
// We can probably do better here by just ensuring that
114
114
// it has hidden visibility rather than public
115
115
// visibility, as this is primarily here to ensure it's
@@ -126,14 +126,14 @@ fn reachable_non_generics_provider(
126
126
SymbolExportLevel :: Rust
127
127
}
128
128
} else {
129
- symbol_export_level ( tcx, def_id)
129
+ symbol_export_level ( tcx, def_id. to_def_id ( ) )
130
130
} ;
131
131
debug ! (
132
132
"EXPORTED SYMBOL (local): {} ({:?})" ,
133
- tcx. symbol_name( Instance :: mono( tcx, def_id) ) ,
133
+ tcx. symbol_name( Instance :: mono( tcx, def_id. to_def_id ( ) ) ) ,
134
134
export_level
135
135
) ;
136
- ( def_id, export_level)
136
+ ( def_id. to_def_id ( ) , export_level)
137
137
} )
138
138
. collect ( ) ;
139
139
@@ -361,8 +361,8 @@ fn upstream_drop_glue_for_provider<'tcx>(
361
361
}
362
362
363
363
fn 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 ) )
366
366
} else {
367
367
bug ! ( "is_unreachable_local_definition called with non-local DefId: {:?}" , def_id)
368
368
}
0 commit comments