@@ -733,6 +733,56 @@ fn each_child_of_item_or_crate(intr: @ident_interner,
733
733
child_def_id,
734
734
cdata. cnum ) ;
735
735
callback ( def_like, child_name) ;
736
+
737
+ }
738
+ }
739
+
740
+ true
741
+ } ;
742
+
743
+ // As a special case, iterate over all static methods of
744
+ // associated implementations too. This is a bit of a botch.
745
+ // --pcwalton
746
+ let _ = do reader:: tagged_docs ( item_doc,
747
+ tag_items_data_item_inherent_impl)
748
+ |inherent_impl_def_id_doc| {
749
+ let inherent_impl_def_id = item_def_id ( inherent_impl_def_id_doc,
750
+ cdata) ;
751
+ let items = reader:: get_doc ( reader:: Doc ( cdata. data ) , tag_items) ;
752
+ match maybe_find_item ( inherent_impl_def_id. node , items) {
753
+ None => { }
754
+ Some ( inherent_impl_doc) => {
755
+ let _ = do reader:: tagged_docs ( inherent_impl_doc,
756
+ tag_item_impl_method)
757
+ |impl_method_def_id_doc| {
758
+ let impl_method_def_id =
759
+ reader:: with_doc_data ( impl_method_def_id_doc,
760
+ parse_def_id) ;
761
+ let impl_method_def_id =
762
+ translate_def_id ( cdata, impl_method_def_id) ;
763
+ match maybe_find_item ( impl_method_def_id. node , items) {
764
+ None => { }
765
+ Some ( impl_method_doc) => {
766
+ match item_family ( impl_method_doc) {
767
+ StaticMethod | UnsafeStaticMethod => {
768
+ // Hand off the static method
769
+ // to the callback.
770
+ let static_method_name =
771
+ item_name ( intr, impl_method_doc) ;
772
+ let static_method_def_like =
773
+ item_to_def_like ( impl_method_doc,
774
+ impl_method_def_id,
775
+ cdata. cnum ) ;
776
+ callback ( static_method_def_like,
777
+ static_method_name) ;
778
+ }
779
+ _ => { }
780
+ }
781
+ }
782
+ }
783
+
784
+ true
785
+ } ;
736
786
}
737
787
}
738
788
@@ -1403,15 +1453,9 @@ pub fn each_implementation_for_type(cdata: cmd,
1403
1453
id : ast:: NodeId ,
1404
1454
callback : & fn ( ast:: def_id ) ) {
1405
1455
let item_doc = lookup_item ( id, cdata. data ) ;
1406
- /*println(fmt!(">>> reading inherent impls from %s",
1407
- token::ident_to_str(&item_name(token::get_ident_interner(),
1408
- item_doc))));*/
1409
1456
do reader:: tagged_docs ( item_doc, tag_items_data_item_inherent_impl)
1410
1457
|impl_doc| {
1411
1458
let implementation_def_id = item_def_id ( impl_doc, cdata) ;
1412
- /*println(fmt!(">>>>> read inherent impl: %d:%d",
1413
- implementation_def_id.crate,
1414
- implementation_def_id.node));*/
1415
1459
callback ( implementation_def_id) ;
1416
1460
true
1417
1461
} ;
0 commit comments