@@ -1016,7 +1016,7 @@ pub struct Resolver<'a, 'tcx: 'a> {
1016
1016
1017
1017
graph_root : Module < ' a > ,
1018
1018
1019
- trait_item_map : FnvHashMap < ( Name , DefId ) , DefId > ,
1019
+ trait_item_map : FnvHashMap < ( Name , DefId ) , bool /* is static method? */ > ,
1020
1020
1021
1021
structs : FnvHashMap < DefId , Vec < Name > > ,
1022
1022
@@ -2823,25 +2823,6 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
2823
2823
}
2824
2824
}
2825
2825
2826
- fn is_static_method ( this : & Resolver , did : DefId ) -> bool {
2827
- if let Some ( node_id) = this. ast_map . as_local_node_id ( did) {
2828
- let sig = match this. ast_map . get ( node_id) {
2829
- hir_map:: NodeTraitItem ( trait_item) => match trait_item. node {
2830
- hir:: MethodTraitItem ( ref sig, _) => sig,
2831
- _ => return false ,
2832
- } ,
2833
- hir_map:: NodeImplItem ( impl_item) => match impl_item. node {
2834
- hir:: ImplItemKind :: Method ( ref sig, _) => sig,
2835
- _ => return false ,
2836
- } ,
2837
- _ => return false ,
2838
- } ;
2839
- sig. explicit_self . node == hir:: SelfStatic
2840
- } else {
2841
- this. session . cstore . is_static_method ( did)
2842
- }
2843
- }
2844
-
2845
2826
if let Some ( node_id) = self . current_self_type . as_ref ( ) . and_then ( extract_node_id) {
2846
2827
// Look for a field with the same name in the current self_type.
2847
2828
match self . def_map . borrow ( ) . get ( & node_id) . map ( |d| d. full_def ( ) ) {
@@ -2862,8 +2843,8 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
2862
2843
2863
2844
// Look for a method in the current trait.
2864
2845
if let Some ( ( trait_did, ref trait_ref) ) = self . current_trait_ref {
2865
- if let Some ( & did ) = self . trait_item_map . get ( & ( name, trait_did) ) {
2866
- if is_static_method ( self , did ) {
2846
+ if let Some ( & is_static_method ) = self . trait_item_map . get ( & ( name, trait_did) ) {
2847
+ if is_static_method {
2867
2848
return TraitMethod ( path_names_to_string ( & trait_ref. path , 0 ) ) ;
2868
2849
} else {
2869
2850
return TraitItem ;
0 commit comments