@@ -119,7 +119,7 @@ fn exported_symbols_provider_local<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
119
119
let special_runtime_crate = tcx. is_panic_runtime ( LOCAL_CRATE ) ||
120
120
tcx. is_compiler_builtins ( LOCAL_CRATE ) ;
121
121
122
- let mut reachable_non_generics: DefIdSet = tcx. reachable_set ( LOCAL_CRATE ) . 0
122
+ let reachable_non_generics: DefIdSet = tcx. reachable_set ( LOCAL_CRATE ) . 0
123
123
. iter ( )
124
124
. filter_map ( |& node_id| {
125
125
// We want to ignore some FFI functions that are not exposed from
@@ -174,14 +174,6 @@ fn exported_symbols_provider_local<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
174
174
} )
175
175
. collect ( ) ;
176
176
177
- if let Some ( id) = tcx. sess . derive_registrar_fn . get ( ) {
178
- reachable_non_generics. insert ( tcx. hir . local_def_id ( id) ) ;
179
- }
180
-
181
- if let Some ( id) = tcx. sess . plugin_registrar_fn . get ( ) {
182
- reachable_non_generics. insert ( tcx. hir . local_def_id ( id) ) ;
183
- }
184
-
185
177
let mut symbols: Vec < _ > = reachable_non_generics
186
178
. iter ( )
187
179
. map ( |& def_id| {
@@ -211,6 +203,16 @@ fn exported_symbols_provider_local<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
211
203
} )
212
204
. collect ( ) ;
213
205
206
+ if let Some ( id) = tcx. sess . derive_registrar_fn . get ( ) {
207
+ let def_id = tcx. hir . local_def_id ( id) ;
208
+ symbols. push ( ( ExportedSymbol :: NonGeneric ( def_id) , SymbolExportLevel :: C ) ) ;
209
+ }
210
+
211
+ if let Some ( id) = tcx. sess . plugin_registrar_fn . get ( ) {
212
+ let def_id = tcx. hir . local_def_id ( id) ;
213
+ symbols. push ( ( ExportedSymbol :: NonGeneric ( def_id) , SymbolExportLevel :: C ) ) ;
214
+ }
215
+
214
216
if let Some ( _) = * tcx. sess . entry_fn . borrow ( ) {
215
217
let symbol_name = "main" . to_string ( ) ;
216
218
let exported_symbol = ExportedSymbol :: NoDefId ( SymbolName :: new ( & symbol_name) ) ;
0 commit comments