@@ -272,7 +272,7 @@ pub struct Cache {
272272 // then the fully qualified name of the structure isn't presented in `paths`
273273 // yet when its implementation methods are being indexed. Caches such methods
274274 // and their parent id here and indexes them at the end of crate parsing.
275- orphan_methods : Vec < ( DefId , clean:: Item ) > ,
275+ orphan_impl_items : Vec < ( DefId , clean:: Item ) > ,
276276}
277277
278278/// Temporary storage for data obtained during `RustdocVisitor::clean()`.
@@ -529,7 +529,7 @@ pub fn run(mut krate: clean::Crate,
529529 seen_mod : false ,
530530 stripped_mod : false ,
531531 access_levels : krate. access_levels . clone ( ) ,
532- orphan_methods : Vec :: new ( ) ,
532+ orphan_impl_items : Vec :: new ( ) ,
533533 traits : mem:: replace ( & mut krate. external_traits , FnvHashMap ( ) ) ,
534534 deref_trait_did : deref_trait_did,
535535 typarams : external_typarams,
@@ -581,12 +581,12 @@ fn build_index(krate: &clean::Crate, cache: &mut Cache) -> String {
581581 let mut crate_paths = Vec :: < Json > :: new ( ) ;
582582
583583 let Cache { ref mut search_index,
584- ref orphan_methods ,
584+ ref orphan_impl_items ,
585585 ref mut paths, .. } = * cache;
586586
587- // Attach all orphan methods to the type's definition if the type
587+ // Attach all orphan items to the type's definition if the type
588588 // has since been learned.
589- for & ( did, ref item) in orphan_methods {
589+ for & ( did, ref item) in orphan_impl_items {
590590 if let Some ( & ( ref fqp, _) ) = paths. get ( & did) {
591591 search_index. push ( IndexItem {
592592 ty : item_type ( item) ,
@@ -1024,23 +1024,22 @@ impl DocFolder for Cache {
10241024
10251025 // Index this method for searching later on
10261026 if let Some ( ref s) = item. name {
1027- let ( parent, is_method ) = match item. inner {
1027+ let ( parent, is_inherent_impl_item ) = match item. inner {
10281028 clean:: StrippedItem ( ..) => ( ( None , None ) , false ) ,
10291029 clean:: AssociatedConstItem ( ..) |
10301030 clean:: TypedefItem ( _, true ) if self . parent_is_trait_impl => {
10311031 // skip associated items in trait impls
10321032 ( ( None , None ) , false )
10331033 }
10341034 clean:: AssociatedTypeItem ( ..) |
1035- clean:: AssociatedConstItem ( ..) |
10361035 clean:: TyMethodItem ( ..) |
10371036 clean:: StructFieldItem ( ..) |
10381037 clean:: VariantItem ( ..) => {
10391038 ( ( Some ( * self . parent_stack . last ( ) . unwrap ( ) ) ,
10401039 Some ( & self . stack [ ..self . stack . len ( ) - 1 ] ) ) ,
10411040 false )
10421041 }
1043- clean:: MethodItem ( ..) => {
1042+ clean:: MethodItem ( ..) | clean :: AssociatedConstItem ( .. ) => {
10441043 if self . parent_stack . is_empty ( ) {
10451044 ( ( None , None ) , false )
10461045 } else {
@@ -1066,7 +1065,7 @@ impl DocFolder for Cache {
10661065 } ;
10671066
10681067 match parent {
1069- ( parent, Some ( path) ) if is_method || ( !self . stripped_mod ) => {
1068+ ( parent, Some ( path) ) if is_inherent_impl_item || ( !self . stripped_mod ) => {
10701069 debug_assert ! ( !item. is_stripped( ) ) ;
10711070
10721071 // A crate has a module at its root, containing all items,
@@ -1084,10 +1083,10 @@ impl DocFolder for Cache {
10841083 } ) ;
10851084 }
10861085 }
1087- ( Some ( parent) , None ) if is_method => {
1086+ ( Some ( parent) , None ) if is_inherent_impl_item => {
10881087 // We have a parent, but we don't know where they're
10891088 // defined yet. Wait for later to index this item.
1090- self . orphan_methods . push ( ( parent, item. clone ( ) ) ) ;
1089+ self . orphan_impl_items . push ( ( parent, item. clone ( ) ) ) ;
10911090 }
10921091 _ => { }
10931092 }
0 commit comments