File tree Expand file tree Collapse file tree 3 files changed +23
-8
lines changed Expand file tree Collapse file tree 3 files changed +23
-8
lines changed Original file line number Diff line number Diff line change 11//! Support for inlining external documentation into the current AST.
22
3- use std:: collections:: VecDeque ;
43use std:: iter:: once;
54use std:: sync:: Arc ;
65
@@ -425,15 +424,16 @@ crate fn build_impl(
425424 }
426425
427426 // Return if the trait itself or any types of the generic parameters are doc(hidden).
428- let mut deque: VecDeque < & Type > = trait_. iter ( ) . collect ( ) ;
429- while let Some ( ty) = deque. pop_back ( ) {
427+ let mut stack: Vec < & Type > = trait_. iter ( ) . collect ( ) ;
428+ stack. push ( & for_) ;
429+ while let Some ( ty) = stack. pop ( ) {
430430 if let Some ( did) = ty. def_id ( ) {
431431 if cx. tcx . get_attrs ( did) . lists ( sym:: doc) . has_word ( sym:: hidden) {
432432 return ;
433433 }
434434 }
435435 if let Some ( generics) = ty. generics ( ) {
436- deque . extend ( generics) ;
436+ stack . extend ( generics) ;
437437 }
438438 }
439439
Original file line number Diff line number Diff line change 11#[ doc( hidden) ]
22pub enum HiddenType { }
3+
4+ #[ doc( hidden) ]
5+ pub trait HiddenTrait { }
Original file line number Diff line number Diff line change 44// aux-build:cross-crate-hidden.rs
55extern crate cross_crate_hidden;
66
7- pub use :: cross_crate_hidden:: HiddenType ; // OK, not re-exported
7+ pub use :: cross_crate_hidden:: { HiddenType , HiddenTrait } ; // OK, not re-exported
88
99pub enum MyLibType { }
1010
@@ -15,9 +15,21 @@ impl From<HiddenType> for MyLibType {
1515 }
1616}
1717
18- // @!has foo/enum.MyLibType.html '//*[@id="impl-From%3COption%3COption%3COption%3COption%3CHiddenType%3E%3E%3E%3E%3E"]' 'impl From<Option<Option<Option<Option<HiddenType>>>>> for MyLibType'
19- impl From < Option < Option < Option < Option < HiddenType > > > > > for MyLibType {
20- fn from ( it : Option < Option < Option < Option < HiddenType > > > > ) -> MyLibType {
18+ pub struct T < T > ( T ) ;
19+
20+ // @!has foo/enum.MyLibType.html '//*[@id="impl-From%3CT%3CT%3CT%3CT%3CHiddenType%3E%3E%3E%3E%3E"]' 'impl From<T<T<T<T<HiddenType>>>>> for MyLibType'
21+ impl From < T < T < T < T < HiddenType > > > > > for MyLibType {
22+ fn from ( it : T < T < T < T < HiddenType > > > > ) -> MyLibType {
2123 todo ! ( )
2224 }
2325}
26+
27+ // @!has foo/enum.MyLibType.html '//*[@id="impl-HiddenTrait"]' 'impl HiddenTrait for MyLibType'
28+ impl HiddenTrait for MyLibType { }
29+
30+ // @!has foo/struct.T.html '//*[@id="impl-From%3CMyLibType%3E"]' 'impl From<MyLibType> for T<T<T<T<HiddenType>>>>'
31+ impl From < MyLibType > for T < T < T < T < HiddenType > > > > {
32+ fn from ( it : MyLibType ) -> T < T < T < T < HiddenType > > > > {
33+ match it { }
34+ }
35+ }
You can’t perform that action at this time.
0 commit comments