@@ -250,7 +250,7 @@ enum FallbackSuggestion {
250250 Method ,
251251 TraitItem ,
252252 StaticMethod ( String ) ,
253- StaticTraitMethod ( String ) ,
253+ TraitMethod ( String ) ,
254254}
255255
256256enum TypeParameters < ' a > {
@@ -1386,17 +1386,17 @@ impl<'a> Resolver<'a> {
13861386 . node {
13871387 SelfStatic => {
13881388 // Static methods become
1389- // `def_static_method`s.
1390- DefStaticMethod (
1391- local_def ( method. id ) ,
1392- FromImpl ( local_def ( item. id ) ) ,
1393- method. pe_fn_style ( ) )
1389+ // `DefStaticMethod`s.
1390+ DefStaticMethod ( local_def ( method. id ) ,
1391+ FromImpl ( local_def ( item. id ) ) ,
1392+ method. pe_fn_style ( ) )
13941393 }
13951394 _ => {
13961395 // Non-static methods become
1397- // `def_method `s.
1396+ // `DefMethod `s.
13981397 DefMethod ( local_def ( method. id ) ,
1399- None )
1398+ None ,
1399+ FromImpl ( local_def ( item. id ) ) )
14001400 }
14011401 } ;
14021402
@@ -1476,19 +1476,18 @@ impl<'a> Resolver<'a> {
14761476 let ( def, static_flag) = match ty_m. explicit_self
14771477 . node {
14781478 SelfStatic => {
1479- // Static methods become
1480- // `def_static_method`s.
1479+ // Static methods become `DefStaticMethod`s.
14811480 ( DefStaticMethod (
14821481 local_def ( ty_m. id ) ,
14831482 FromTrait ( local_def ( item. id ) ) ,
14841483 ty_m. fn_style ) ,
14851484 StaticMethodTraitItemKind )
14861485 }
14871486 _ => {
1488- // Non-static methods become
1489- // `def_method`s.
1487+ // Non-static methods become `DefMethod`s.
14901488 ( DefMethod ( local_def ( ty_m. id ) ,
1491- Some ( local_def ( item. id ) ) ) ,
1489+ Some ( local_def ( item. id ) ) ,
1490+ FromTrait ( local_def ( item. id ) ) ) ,
14921491 NonstaticMethodTraitItemKind )
14931492 }
14941493 } ;
@@ -4607,8 +4606,7 @@ impl<'a> Resolver<'a> {
46074606 // We also need a new scope for the method-
46084607 // specific type parameters.
46094608 this. resolve_method (
4610- MethodRibKind ( id,
4611- ProvidedMethod ( method. id ) ) ,
4609+ MethodRibKind ( id, ProvidedMethod ( method. id ) ) ,
46124610 & * * method) ;
46134611 }
46144612 TypeImplItem ( ref typedef) => {
@@ -5393,8 +5391,8 @@ impl<'a> Resolver<'a> {
53935391
53945392 let ident = path. segments . last ( ) . unwrap ( ) . identifier ;
53955393 let def = match self . resolve_definition_of_name_in_module ( containing_module. clone ( ) ,
5396- ident. name ,
5397- namespace) {
5394+ ident. name ,
5395+ namespace) {
53985396 NoNameDefinition => {
53995397 // We failed to resolve the name. Report an error.
54005398 return None ;
@@ -5403,26 +5401,6 @@ impl<'a> Resolver<'a> {
54035401 ( def, last_private. or ( lp) )
54045402 }
54055403 } ;
5406- match containing_module. kind . get ( ) {
5407- TraitModuleKind | ImplModuleKind => {
5408- match containing_module. def_id . get ( ) {
5409- Some ( def_id) => {
5410- match self . trait_item_map . find ( & ( ident. name , def_id) ) {
5411- Some ( & StaticMethodTraitItemKind ) => ( ) ,
5412- Some ( & TypeTraitItemKind ) => ( ) ,
5413- None => ( ) ,
5414- Some ( & NonstaticMethodTraitItemKind ) => {
5415- debug ! ( "containing module was a trait or impl \
5416- and name was a method -> not resolved") ;
5417- return None ;
5418- }
5419- }
5420- } ,
5421- _ => ( ) ,
5422- }
5423- } ,
5424- _ => ( ) ,
5425- }
54265404 match containing_module. def_id . get ( ) {
54275405 Some ( DefId { krate : kid, ..} ) => { self . used_crates . insert ( kid) ; } ,
54285406 _ => { }
@@ -5668,8 +5646,8 @@ impl<'a> Resolver<'a> {
56685646 FromTrait ( _) => unreachable ! ( )
56695647 }
56705648 }
5671- Some ( DefMethod ( _, None ) ) if allowed == Everything => return Method ,
5672- Some ( DefMethod ( _, Some ( _) ) ) => return TraitItem ,
5649+ Some ( DefMethod ( _, None , _ ) ) if allowed == Everything => return Method ,
5650+ Some ( DefMethod ( _, Some ( _) , _ ) ) => return TraitItem ,
56735651 _ => ( )
56745652 }
56755653 }
@@ -5684,7 +5662,9 @@ impl<'a> Resolver<'a> {
56845662 let path_str = self . path_idents_to_string ( & trait_ref. path ) ;
56855663
56865664 match self . trait_item_map . find ( & ( name, did) ) {
5687- Some ( & StaticMethodTraitItemKind ) => return StaticTraitMethod ( path_str) ,
5665+ Some ( & StaticMethodTraitItemKind ) => {
5666+ return TraitMethod ( path_str)
5667+ }
56885668 Some ( _) => return TraitItem ,
56895669 None => { }
56905670 }
@@ -5810,7 +5790,7 @@ impl<'a> Resolver<'a> {
58105790 Method
58115791 | TraitItem =>
58125792 format ! ( "to call `self.{}`" , wrong_name) ,
5813- StaticTraitMethod ( path_str)
5793+ TraitMethod ( path_str)
58145794 | StaticMethod ( path_str) =>
58155795 format ! ( "to call `{}::{}`" , path_str, wrong_name)
58165796 } ;
0 commit comments