@@ -1016,7 +1016,7 @@ pub struct Resolver<'a, 'tcx: 'a> {
10161016
10171017 graph_root : Module < ' a > ,
10181018
1019- trait_item_map : FnvHashMap < ( Name , DefId ) , DefId > ,
1019+ trait_item_map : FnvHashMap < ( Name , DefId ) , bool /* is static method? */ > ,
10201020
10211021 structs : FnvHashMap < DefId , Vec < Name > > ,
10221022
@@ -2823,25 +2823,6 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
28232823 }
28242824 }
28252825
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-
28452826 if let Some ( node_id) = self . current_self_type . as_ref ( ) . and_then ( extract_node_id) {
28462827 // Look for a field with the same name in the current self_type.
28472828 match self . def_map . borrow ( ) . get ( & node_id) . map ( |d| d. full_def ( ) ) {
@@ -2862,8 +2843,8 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
28622843
28632844 // Look for a method in the current trait.
28642845 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 {
28672848 return TraitMethod ( path_names_to_string ( & trait_ref. path , 0 ) ) ;
28682849 } else {
28692850 return TraitItem ;
0 commit comments