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