File tree 3 files changed +23
-8
lines changed
3 files changed +23
-8
lines changed Original file line number Diff line number Diff line change 1
1
//! Support for inlining external documentation into the current AST.
2
2
3
- use std:: collections:: VecDeque ;
4
3
use std:: iter:: once;
5
4
use std:: sync:: Arc ;
6
5
@@ -425,15 +424,16 @@ crate fn build_impl(
425
424
}
426
425
427
426
// 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 ( ) {
430
430
if let Some ( did) = ty. def_id ( ) {
431
431
if cx. tcx . get_attrs ( did) . lists ( sym:: doc) . has_word ( sym:: hidden) {
432
432
return ;
433
433
}
434
434
}
435
435
if let Some ( generics) = ty. generics ( ) {
436
- deque . extend ( generics) ;
436
+ stack . extend ( generics) ;
437
437
}
438
438
}
439
439
Original file line number Diff line number Diff line change 1
1
#[ doc( hidden) ]
2
2
pub enum HiddenType { }
3
+
4
+ #[ doc( hidden) ]
5
+ pub trait HiddenTrait { }
Original file line number Diff line number Diff line change 4
4
// aux-build:cross-crate-hidden.rs
5
5
extern crate cross_crate_hidden;
6
6
7
- pub use :: cross_crate_hidden:: HiddenType ; // OK, not re-exported
7
+ pub use :: cross_crate_hidden:: { HiddenType , HiddenTrait } ; // OK, not re-exported
8
8
9
9
pub enum MyLibType { }
10
10
@@ -15,9 +15,21 @@ impl From<HiddenType> for MyLibType {
15
15
}
16
16
}
17
17
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 {
21
23
todo ! ( )
22
24
}
23
25
}
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