@@ -394,6 +394,7 @@ impl<'a, 'b, 'tcx> BuildReducedGraphVisitor<'a, 'b, 'tcx> {
394
394
id : NodeId ,
395
395
parent_prefix : & [ Segment ] ,
396
396
nested : bool ,
397
+ list_stem : bool ,
397
398
// The whole `use` item
398
399
item : & Item ,
399
400
vis : ty:: Visibility ,
@@ -404,7 +405,9 @@ impl<'a, 'b, 'tcx> BuildReducedGraphVisitor<'a, 'b, 'tcx> {
404
405
parent_prefix, use_tree, nested
405
406
) ;
406
407
407
- if nested {
408
+ // Top level use tree reuses the item's id and list stems reuse their parent
409
+ // use tree's ids, so in both cases their visibilities are already filled.
410
+ if nested && !list_stem {
408
411
self . r . feed_visibility ( self . r . local_def_id ( id) , vis) ;
409
412
}
410
413
@@ -592,7 +595,7 @@ impl<'a, 'b, 'tcx> BuildReducedGraphVisitor<'a, 'b, 'tcx> {
592
595
for & ( ref tree, id) in items {
593
596
self . build_reduced_graph_for_use_tree (
594
597
// This particular use tree
595
- tree, id, & prefix, true , // The whole `use` item
598
+ tree, id, & prefix, true , false , // The whole `use` item
596
599
item, vis, root_span,
597
600
) ;
598
601
}
@@ -613,6 +616,7 @@ impl<'a, 'b, 'tcx> BuildReducedGraphVisitor<'a, 'b, 'tcx> {
613
616
id,
614
617
& prefix,
615
618
true ,
619
+ true ,
616
620
// The whole `use` item
617
621
item,
618
622
ty:: Visibility :: Restricted (
@@ -648,6 +652,7 @@ impl<'a, 'b, 'tcx> BuildReducedGraphVisitor<'a, 'b, 'tcx> {
648
652
item. id ,
649
653
& [ ] ,
650
654
false ,
655
+ false ,
651
656
// The whole `use` item
652
657
item,
653
658
vis,
0 commit comments