@@ -271,7 +271,7 @@ pub struct Cache {
271271 // then the fully qualified name of the structure isn't presented in `paths`
272272 // yet when its implementation methods are being indexed. Caches such methods
273273 // and their parent id here and indexes them at the end of crate parsing.
274- orphan_methods : Vec < ( DefId , clean:: Item ) > ,
274+ orphan_impl_items : Vec < ( DefId , clean:: Item ) > ,
275275}
276276
277277/// Temporary storage for data obtained during `RustdocVisitor::clean()`.
@@ -528,7 +528,7 @@ pub fn run(mut krate: clean::Crate,
528528 seen_mod : false ,
529529 stripped_mod : false ,
530530 access_levels : krate. access_levels . clone ( ) ,
531- orphan_methods : Vec :: new ( ) ,
531+ orphan_impl_items : Vec :: new ( ) ,
532532 traits : mem:: replace ( & mut krate. external_traits , FnvHashMap ( ) ) ,
533533 deref_trait_did : deref_trait_did,
534534 typarams : external_typarams,
@@ -580,12 +580,12 @@ fn build_index(krate: &clean::Crate, cache: &mut Cache) -> String {
580580 let mut crate_paths = Vec :: < Json > :: new ( ) ;
581581
582582 let Cache { ref mut search_index,
583- ref orphan_methods ,
583+ ref orphan_impl_items ,
584584 ref mut paths, .. } = * cache;
585585
586- // Attach all orphan methods to the type's definition if the type
586+ // Attach all orphan items to the type's definition if the type
587587 // has since been learned.
588- for & ( did, ref item) in orphan_methods {
588+ for & ( did, ref item) in orphan_impl_items {
589589 if let Some ( & ( ref fqp, _) ) = paths. get ( & did) {
590590 search_index. push ( IndexItem {
591591 ty : item_type ( item) ,
@@ -1023,23 +1023,22 @@ impl DocFolder for Cache {
10231023
10241024 // Index this method for searching later on
10251025 if let Some ( ref s) = item. name {
1026- let ( parent, is_method ) = match item. inner {
1026+ let ( parent, is_inherent_impl_item ) = match item. inner {
10271027 clean:: StrippedItem ( ..) => ( ( None , None ) , false ) ,
10281028 clean:: AssociatedConstItem ( ..) |
10291029 clean:: TypedefItem ( _, true ) if self . parent_is_trait_impl => {
10301030 // skip associated items in trait impls
10311031 ( ( None , None ) , false )
10321032 }
10331033 clean:: AssociatedTypeItem ( ..) |
1034- clean:: AssociatedConstItem ( ..) |
10351034 clean:: TyMethodItem ( ..) |
10361035 clean:: StructFieldItem ( ..) |
10371036 clean:: VariantItem ( ..) => {
10381037 ( ( Some ( * self . parent_stack . last ( ) . unwrap ( ) ) ,
10391038 Some ( & self . stack [ ..self . stack . len ( ) - 1 ] ) ) ,
10401039 false )
10411040 }
1042- clean:: MethodItem ( ..) => {
1041+ clean:: MethodItem ( ..) | clean :: AssociatedConstItem ( .. ) => {
10431042 if self . parent_stack . is_empty ( ) {
10441043 ( ( None , None ) , false )
10451044 } else {
@@ -1064,7 +1063,7 @@ impl DocFolder for Cache {
10641063 } ;
10651064
10661065 match parent {
1067- ( parent, Some ( path) ) if is_method || ( !self . stripped_mod ) => {
1066+ ( parent, Some ( path) ) if is_inherent_impl_item || ( !self . stripped_mod ) => {
10681067 debug_assert ! ( !item. is_stripped( ) ) ;
10691068
10701069 // A crate has a module at its root, containing all items,
@@ -1082,10 +1081,10 @@ impl DocFolder for Cache {
10821081 } ) ;
10831082 }
10841083 }
1085- ( Some ( parent) , None ) if is_method => {
1084+ ( Some ( parent) , None ) if is_inherent_impl_item => {
10861085 // We have a parent, but we don't know where they're
10871086 // defined yet. Wait for later to index this item.
1088- self . orphan_methods . push ( ( parent, item. clone ( ) ) ) ;
1087+ self . orphan_impl_items . push ( ( parent, item. clone ( ) ) ) ;
10891088 }
10901089 _ => { }
10911090 }
0 commit comments