@@ -271,7 +271,7 @@ pub struct Cache {
271
271
// then the fully qualified name of the structure isn't presented in `paths`
272
272
// yet when its implementation methods are being indexed. Caches such methods
273
273
// 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 ) > ,
275
275
}
276
276
277
277
/// Temporary storage for data obtained during `RustdocVisitor::clean()`.
@@ -528,7 +528,7 @@ pub fn run(mut krate: clean::Crate,
528
528
seen_mod : false ,
529
529
stripped_mod : false ,
530
530
access_levels : krate. access_levels . clone ( ) ,
531
- orphan_methods : Vec :: new ( ) ,
531
+ orphan_impl_items : Vec :: new ( ) ,
532
532
traits : mem:: replace ( & mut krate. external_traits , FnvHashMap ( ) ) ,
533
533
deref_trait_did : deref_trait_did,
534
534
typarams : external_typarams,
@@ -580,12 +580,12 @@ fn build_index(krate: &clean::Crate, cache: &mut Cache) -> String {
580
580
let mut crate_paths = Vec :: < Json > :: new ( ) ;
581
581
582
582
let Cache { ref mut search_index,
583
- ref orphan_methods ,
583
+ ref orphan_impl_items ,
584
584
ref mut paths, .. } = * cache;
585
585
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
587
587
// has since been learned.
588
- for & ( did, ref item) in orphan_methods {
588
+ for & ( did, ref item) in orphan_impl_items {
589
589
if let Some ( & ( ref fqp, _) ) = paths. get ( & did) {
590
590
search_index. push ( IndexItem {
591
591
ty : item_type ( item) ,
@@ -1023,23 +1023,22 @@ impl DocFolder for Cache {
1023
1023
1024
1024
// Index this method for searching later on
1025
1025
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 {
1027
1027
clean:: StrippedItem ( ..) => ( ( None , None ) , false ) ,
1028
1028
clean:: AssociatedConstItem ( ..) |
1029
1029
clean:: TypedefItem ( _, true ) if self . parent_is_trait_impl => {
1030
1030
// skip associated items in trait impls
1031
1031
( ( None , None ) , false )
1032
1032
}
1033
1033
clean:: AssociatedTypeItem ( ..) |
1034
- clean:: AssociatedConstItem ( ..) |
1035
1034
clean:: TyMethodItem ( ..) |
1036
1035
clean:: StructFieldItem ( ..) |
1037
1036
clean:: VariantItem ( ..) => {
1038
1037
( ( Some ( * self . parent_stack . last ( ) . unwrap ( ) ) ,
1039
1038
Some ( & self . stack [ ..self . stack . len ( ) - 1 ] ) ) ,
1040
1039
false )
1041
1040
}
1042
- clean:: MethodItem ( ..) => {
1041
+ clean:: MethodItem ( ..) | clean :: AssociatedConstItem ( .. ) => {
1043
1042
if self . parent_stack . is_empty ( ) {
1044
1043
( ( None , None ) , false )
1045
1044
} else {
@@ -1064,7 +1063,7 @@ impl DocFolder for Cache {
1064
1063
} ;
1065
1064
1066
1065
match parent {
1067
- ( parent, Some ( path) ) if is_method || ( !self . stripped_mod ) => {
1066
+ ( parent, Some ( path) ) if is_inherent_impl_item || ( !self . stripped_mod ) => {
1068
1067
debug_assert ! ( !item. is_stripped( ) ) ;
1069
1068
1070
1069
// A crate has a module at its root, containing all items,
@@ -1082,10 +1081,10 @@ impl DocFolder for Cache {
1082
1081
} ) ;
1083
1082
}
1084
1083
}
1085
- ( Some ( parent) , None ) if is_method => {
1084
+ ( Some ( parent) , None ) if is_inherent_impl_item => {
1086
1085
// We have a parent, but we don't know where they're
1087
1086
// 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 ( ) ) ) ;
1089
1088
}
1090
1089
_ => { }
1091
1090
}
0 commit comments