@@ -549,6 +549,7 @@ enum MaybeExported<'a> {
549549 Ok ( NodeId ) ,
550550 Impl ( Option < DefId > ) ,
551551 ImplItem ( Result < DefId , & ' a Visibility > ) ,
552+ NestedUse ( & ' a Visibility ) ,
552553}
553554
554555impl MaybeExported < ' _ > {
@@ -559,7 +560,9 @@ impl MaybeExported<'_> {
559560 trait_def_id. as_local ( )
560561 }
561562 MaybeExported :: Impl ( None ) => return true ,
562- MaybeExported :: ImplItem ( Err ( vis) ) => return vis. kind . is_pub ( ) ,
563+ MaybeExported :: ImplItem ( Err ( vis) ) | MaybeExported :: NestedUse ( vis) => {
564+ return vis. kind . is_pub ( ) ;
565+ }
563566 } ;
564567 def_id. map_or ( true , |def_id| r. effective_visibilities . is_exported ( def_id) )
565568 }
@@ -2284,7 +2287,7 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
22842287 fn resolve_item ( & mut self , item : & ' ast Item ) {
22852288 let mod_inner_docs =
22862289 matches ! ( item. kind, ItemKind :: Mod ( ..) ) && rustdoc:: inner_docs ( & item. attrs ) ;
2287- if !mod_inner_docs && !matches ! ( item. kind, ItemKind :: Impl ( ..) ) {
2290+ if !mod_inner_docs && !matches ! ( item. kind, ItemKind :: Impl ( ..) | ItemKind :: Use ( .. ) ) {
22882291 self . resolve_doc_links ( & item. attrs , MaybeExported :: Ok ( item. id ) ) ;
22892292 }
22902293
@@ -2428,6 +2431,12 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
24282431 }
24292432
24302433 ItemKind :: Use ( ref use_tree) => {
2434+ let maybe_exported = match use_tree. kind {
2435+ UseTreeKind :: Simple ( _) | UseTreeKind :: Glob => MaybeExported :: Ok ( item. id ) ,
2436+ UseTreeKind :: Nested ( _) => MaybeExported :: NestedUse ( & item. vis ) ,
2437+ } ;
2438+ self . resolve_doc_links ( & item. attrs , maybe_exported) ;
2439+
24312440 self . future_proof_import ( use_tree) ;
24322441 }
24332442
0 commit comments