File tree 4 files changed +29
-1
lines changed
4 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -2494,6 +2494,17 @@ impl Import {
2494
2494
pub ( crate ) fn new_glob ( source : ImportSource , should_be_displayed : bool ) -> Self {
2495
2495
Self { kind : ImportKind :: Glob , source, should_be_displayed }
2496
2496
}
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
+ }
2497
2508
}
2498
2509
2499
2510
#[ derive( Clone , Debug ) ]
Original file line number Diff line number Diff line change @@ -248,6 +248,7 @@ pub(crate) struct ImportStripper<'tcx> {
248
248
impl < ' tcx > DocFolder for ImportStripper < ' tcx > {
249
249
fn fold_item ( & mut self , i : Item ) -> Option < Item > {
250
250
match * i. kind {
251
+ clean:: ImportItem ( imp) if imp. imported_item_is_doc_hidden ( self . tcx ) => None ,
251
252
clean:: ExternCrateItem { .. } | clean:: ImportItem ( ..)
252
253
if i. visibility ( self . tcx ) != Some ( Visibility :: Public ) =>
253
254
{
Original file line number Diff line number Diff line change @@ -14,7 +14,8 @@ mod auto {
14
14
}
15
15
}
16
16
17
- // @count "$.index[*][?(@.name=='builders')]" 2
17
+ // @count "$.index[*][?(@.name=='builders')]" 1
18
+ // @has "$.index[*][?(@.name == 'ActionRowBuilder')"]
18
19
pub use auto:: * ;
19
20
20
21
pub 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