File tree Expand file tree Collapse file tree 4 files changed +29
-1
lines changed Expand file tree Collapse file tree 4 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -2494,6 +2494,17 @@ impl Import {
24942494 pub ( crate ) fn new_glob ( source : ImportSource , should_be_displayed : bool ) -> Self {
24952495 Self { kind : ImportKind :: Glob , source, should_be_displayed }
24962496 }
2497+
2498+ pub ( crate ) fn imported_item_is_doc_hidden ( & self , tcx : TyCtxt < ' _ > ) -> bool {
2499+ match self . source . did {
2500+ Some ( did) => tcx
2501+ . get_attrs ( did, sym:: doc)
2502+ . filter_map ( ast:: Attribute :: meta_item_list)
2503+ . flatten ( )
2504+ . has_word ( sym:: hidden) ,
2505+ None => false ,
2506+ }
2507+ }
24972508}
24982509
24992510#[ derive( Clone , Debug ) ]
Original file line number Diff line number Diff line change @@ -248,6 +248,7 @@ pub(crate) struct ImportStripper<'tcx> {
248248impl < ' tcx > DocFolder for ImportStripper < ' tcx > {
249249 fn fold_item ( & mut self , i : Item ) -> Option < Item > {
250250 match * i. kind {
251+ clean:: ImportItem ( imp) if imp. imported_item_is_doc_hidden ( self . tcx ) => None ,
251252 clean:: ExternCrateItem { .. } | clean:: ImportItem ( ..)
252253 if i. visibility ( self . tcx ) != Some ( Visibility :: Public ) =>
253254 {
Original file line number Diff line number Diff line change @@ -14,7 +14,8 @@ mod auto {
1414 }
1515}
1616
17- // @count "$.index[*][?(@.name=='builders')]" 2
17+ // @count "$.index[*][?(@.name=='builders')]" 1
18+ // @has "$.index[*][?(@.name == 'ActionRowBuilder')"]
1819pub use auto:: * ;
1920
2021pub mod builders {
Original file line number Diff line number Diff line change 1+ // Regression test for <https://github.com/rust-lang/rust/issues/106379>
2+
3+ #![ feature( no_core) ]
4+ #![ no_core]
5+
6+ mod repeat_n {
7+ #[ doc( hidden) ]
8+ pub struct RepeatN { }
9+ }
10+
11+ pub use repeat_n:: RepeatN ;
12+
13+ // @count "$.index[*][?(@.name=='pub_use_doc_hidden')].inner.items[*]" 0
14+ // @!has "$.index[*][?(@.kind=='struct')]"
15+ // @!has "$.index[*][?(@.kind=='import')]"
You can’t perform that action at this time.
0 commit comments