@@ -394,6 +394,7 @@ impl<'a, 'b, 'tcx> BuildReducedGraphVisitor<'a, 'b, 'tcx> {
394394 id : NodeId ,
395395 parent_prefix : & [ Segment ] ,
396396 nested : bool ,
397+ list_stem : bool ,
397398 // The whole `use` item
398399 item : & Item ,
399400 vis : ty:: Visibility ,
@@ -404,7 +405,9 @@ impl<'a, 'b, 'tcx> BuildReducedGraphVisitor<'a, 'b, 'tcx> {
404405 parent_prefix, use_tree, nested
405406 ) ;
406407
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 {
408411 self . r . feed_visibility ( self . r . local_def_id ( id) , vis) ;
409412 }
410413
@@ -592,7 +595,7 @@ impl<'a, 'b, 'tcx> BuildReducedGraphVisitor<'a, 'b, 'tcx> {
592595 for & ( ref tree, id) in items {
593596 self . build_reduced_graph_for_use_tree (
594597 // This particular use tree
595- tree, id, & prefix, true , // The whole `use` item
598+ tree, id, & prefix, true , false , // The whole `use` item
596599 item, vis, root_span,
597600 ) ;
598601 }
@@ -613,6 +616,7 @@ impl<'a, 'b, 'tcx> BuildReducedGraphVisitor<'a, 'b, 'tcx> {
613616 id,
614617 & prefix,
615618 true ,
619+ true ,
616620 // The whole `use` item
617621 item,
618622 ty:: Visibility :: Restricted (
@@ -648,6 +652,7 @@ impl<'a, 'b, 'tcx> BuildReducedGraphVisitor<'a, 'b, 'tcx> {
648652 item. id ,
649653 & [ ] ,
650654 false ,
655+ false ,
651656 // The whole `use` item
652657 item,
653658 vis,
0 commit comments