@@ -326,11 +326,11 @@ fn exported_symbols_provider_local(
326
326
let is_local_to_current_crate = |ty : Ty < ' _ > | {
327
327
let no_refs = ty. peel_refs ( ) ;
328
328
let root_def_id = match no_refs. kind ( ) {
329
- rustc_middle :: ty:: Closure ( closure, _) => * closure,
330
- rustc_middle :: ty:: FnDef ( def_id, _) => * def_id,
331
- rustc_middle :: ty:: Coroutine ( def_id, _) => * def_id,
332
- rustc_middle :: ty:: CoroutineClosure ( def_id, _) => * def_id,
333
- rustc_middle :: ty:: CoroutineWitness ( def_id, _) => * def_id,
329
+ ty:: Closure ( closure, _) => * closure,
330
+ ty:: FnDef ( def_id, _) => * def_id,
331
+ ty:: Coroutine ( def_id, _) => * def_id,
332
+ ty:: CoroutineClosure ( def_id, _) => * def_id,
333
+ ty:: CoroutineWitness ( def_id, _) => * def_id,
334
334
_ => return false ,
335
335
} ;
336
336
let Some ( root_def_id) = root_def_id. as_local ( ) else {
@@ -346,6 +346,7 @@ fn exported_symbols_provider_local(
346
346
arg. walk ( ) . all ( |ty| ty. as_type ( ) . map_or ( true , |ty| !is_local_to_current_crate ( ty) ) )
347
347
} )
348
348
} ;
349
+
349
350
// The symbols created in this loop are sorted below it
350
351
#[ allow( rustc:: potential_query_instability) ]
351
352
for ( mono_item, data) in cgus. iter ( ) . flat_map ( |cgu| cgu. items ( ) . iter ( ) ) {
@@ -395,13 +396,11 @@ fn exported_symbols_provider_local(
395
396
// A little sanity-check
396
397
assert_eq ! ( args. non_erasable_generics( ) . next( ) , Some ( GenericArgKind :: Type ( ty) ) ) ;
397
398
398
- let root_identifier = match ty. kind ( ) {
399
- rustc_middle :: ty:: Adt ( def, args) => Some ( ( def. did ( ) , args) ) ,
400
- rustc_middle :: ty:: Closure ( id, args) => Some ( ( * id, args) ) ,
401
- _ => None ,
399
+ let should_export = match ty. kind ( ) {
400
+ ty:: Adt ( def, args) => is_instantiable_downstream ( def. did ( ) , args. types ( ) ) ,
401
+ ty:: Closure ( id, args) => is_instantiable_downstream ( * id, args. types ( ) ) ,
402
+ _ => true ,
402
403
} ;
403
- let should_export = root_identifier
404
- . map_or ( true , |( did, args) | is_instantiable_downstream ( did, args. types ( ) ) ) ;
405
404
406
405
if should_export {
407
406
symbols. push ( (
0 commit comments