@@ -131,6 +131,9 @@ fn reachable_non_generics_provider(tcx: TyCtxt<'_>, _: LocalCrate) -> DefIdMap<S
131
131
used : codegen_attrs. flags . contains ( CodegenFnAttrFlags :: USED_COMPILER )
132
132
|| codegen_attrs. flags . contains ( CodegenFnAttrFlags :: USED_LINKER )
133
133
|| used,
134
+ rustc_std_internal_symbol : codegen_attrs
135
+ . flags
136
+ . contains ( CodegenFnAttrFlags :: RUSTC_STD_INTERNAL_SYMBOL ) ,
134
137
} ;
135
138
( def_id. to_def_id ( ) , info)
136
139
} )
@@ -143,6 +146,7 @@ fn reachable_non_generics_provider(tcx: TyCtxt<'_>, _: LocalCrate) -> DefIdMap<S
143
146
level : SymbolExportLevel :: C ,
144
147
kind : SymbolExportKind :: Data ,
145
148
used : false ,
149
+ rustc_std_internal_symbol : false ,
146
150
} ,
147
151
) ;
148
152
}
@@ -191,6 +195,7 @@ fn exported_symbols_provider_local<'tcx>(
191
195
level : info. level ,
192
196
kind : SymbolExportKind :: Text ,
193
197
used : info. used ,
198
+ rustc_std_internal_symbol : info. rustc_std_internal_symbol ,
194
199
} ,
195
200
)
196
201
} )
@@ -207,6 +212,7 @@ fn exported_symbols_provider_local<'tcx>(
207
212
level : SymbolExportLevel :: C ,
208
213
kind : SymbolExportKind :: Text ,
209
214
used : false ,
215
+ rustc_std_internal_symbol : false ,
210
216
} ,
211
217
) ) ;
212
218
}
@@ -230,6 +236,7 @@ fn exported_symbols_provider_local<'tcx>(
230
236
level : SymbolExportLevel :: Rust ,
231
237
kind : SymbolExportKind :: Text ,
232
238
used : false ,
239
+ rustc_std_internal_symbol : true ,
233
240
} ,
234
241
) ) ;
235
242
}
@@ -250,6 +257,7 @@ fn exported_symbols_provider_local<'tcx>(
250
257
level : SymbolExportLevel :: C ,
251
258
kind : SymbolExportKind :: Data ,
252
259
used : false ,
260
+ rustc_std_internal_symbol : false ,
253
261
} ,
254
262
)
255
263
} ) ) ;
@@ -275,6 +283,7 @@ fn exported_symbols_provider_local<'tcx>(
275
283
level : SymbolExportLevel :: C ,
276
284
kind : SymbolExportKind :: Data ,
277
285
used : false ,
286
+ rustc_std_internal_symbol : false ,
278
287
} ,
279
288
)
280
289
} ) ) ;
@@ -292,6 +301,7 @@ fn exported_symbols_provider_local<'tcx>(
292
301
level : SymbolExportLevel :: C ,
293
302
kind : SymbolExportKind :: Data ,
294
303
used : true ,
304
+ rustc_std_internal_symbol : false ,
295
305
} ,
296
306
) ) ;
297
307
}
@@ -367,6 +377,8 @@ fn exported_symbols_provider_local<'tcx>(
367
377
}
368
378
}
369
379
380
+ // Note: These all set rustc_std_internal_symbol to false as generic functions must not
381
+ // be marked with this attribute and we are only handling generic functions here.
370
382
match * mono_item {
371
383
MonoItem :: Fn ( Instance { def : InstanceKind :: Item ( def) , args } ) => {
372
384
let has_generics = args. non_erasable_generics ( ) . next ( ) . is_some ( ) ;
@@ -382,6 +394,7 @@ fn exported_symbols_provider_local<'tcx>(
382
394
level : SymbolExportLevel :: Rust ,
383
395
kind : SymbolExportKind :: Text ,
384
396
used : false ,
397
+ rustc_std_internal_symbol : false ,
385
398
} ,
386
399
) ) ;
387
400
}
@@ -404,6 +417,7 @@ fn exported_symbols_provider_local<'tcx>(
404
417
level : SymbolExportLevel :: Rust ,
405
418
kind : SymbolExportKind :: Text ,
406
419
used : false ,
420
+ rustc_std_internal_symbol : false ,
407
421
} ,
408
422
) ) ;
409
423
}
@@ -420,6 +434,7 @@ fn exported_symbols_provider_local<'tcx>(
420
434
level : SymbolExportLevel :: Rust ,
421
435
kind : SymbolExportKind :: Text ,
422
436
used : false ,
437
+ rustc_std_internal_symbol : false ,
423
438
} ,
424
439
) ) ;
425
440
}
@@ -430,6 +445,7 @@ fn exported_symbols_provider_local<'tcx>(
430
445
level : SymbolExportLevel :: Rust ,
431
446
kind : SymbolExportKind :: Text ,
432
447
used : false ,
448
+ rustc_std_internal_symbol : false ,
433
449
} ,
434
450
) ) ;
435
451
}
0 commit comments