@@ -549,6 +549,7 @@ enum MaybeExported<'a> {
549
549
Ok ( NodeId ) ,
550
550
Impl ( Option < DefId > ) ,
551
551
ImplItem ( Result < DefId , & ' a Visibility > ) ,
552
+ NestedUse ( & ' a Visibility ) ,
552
553
}
553
554
554
555
impl MaybeExported < ' _ > {
@@ -559,7 +560,9 @@ impl MaybeExported<'_> {
559
560
trait_def_id. as_local ( )
560
561
}
561
562
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
+ }
563
566
} ;
564
567
def_id. map_or ( true , |def_id| r. effective_visibilities . is_exported ( def_id) )
565
568
}
@@ -2284,7 +2287,7 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
2284
2287
fn resolve_item ( & mut self , item : & ' ast Item ) {
2285
2288
let mod_inner_docs =
2286
2289
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 ( .. ) ) {
2288
2291
self . resolve_doc_links ( & item. attrs , MaybeExported :: Ok ( item. id ) ) ;
2289
2292
}
2290
2293
@@ -2428,6 +2431,12 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
2428
2431
}
2429
2432
2430
2433
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
+
2431
2440
self . future_proof_import ( use_tree) ;
2432
2441
}
2433
2442
0 commit comments