@@ -56,7 +56,7 @@ fn fn_decl<'hir>(node: Node<'hir>) -> Option<&'hir FnDecl<'hir>> {
5656 } ,
5757
5858 Node :: ImplItem ( ref item) => match item. kind {
59- ImplItemKind :: Method ( ref sig, _) => Some ( & sig. decl ) ,
59+ ImplItemKind :: Fn ( ref sig, _) => Some ( & sig. decl ) ,
6060 _ => None ,
6161 } ,
6262
@@ -82,7 +82,7 @@ fn fn_sig<'hir>(node: Node<'hir>) -> Option<&'hir FnSig<'hir>> {
8282 } ,
8383
8484 Node :: ImplItem ( item) => match & item. kind {
85- ImplItemKind :: Method ( sig, _) => Some ( sig) ,
85+ ImplItemKind :: Fn ( sig, _) => Some ( sig) ,
8686 _ => None ,
8787 } ,
8888
@@ -100,13 +100,14 @@ fn associated_body<'hir>(node: Node<'hir>) -> Option<BodyId> {
100100 } ,
101101
102102 Node :: TraitItem ( item) => match item. kind {
103- TraitItemKind :: Const ( _, Some ( body) )
104- | TraitItemKind :: Fn ( _, TraitMethod :: Provided ( body) ) => Some ( body) ,
103+ TraitItemKind :: Const ( _, Some ( body) ) | TraitItemKind :: Fn ( _, TraitFn :: Provided ( body) ) => {
104+ Some ( body)
105+ }
105106 _ => None ,
106107 } ,
107108
108109 Node :: ImplItem ( item) => match item. kind {
109- ImplItemKind :: Const ( _, body) | ImplItemKind :: Method ( _, body) => Some ( body) ,
110+ ImplItemKind :: Const ( _, body) | ImplItemKind :: Fn ( _, body) => Some ( body) ,
110111 _ => None ,
111112 } ,
112113
@@ -299,7 +300,7 @@ impl<'hir> Map<'hir> {
299300 } ,
300301 Node :: ImplItem ( item) => match item. kind {
301302 ImplItemKind :: Const ( ..) => DefKind :: AssocConst ,
302- ImplItemKind :: Method ( ..) => DefKind :: AssocFn ,
303+ ImplItemKind :: Fn ( ..) => DefKind :: AssocFn ,
303304 ImplItemKind :: TyAlias ( ..) => DefKind :: AssocTy ,
304305 ImplItemKind :: OpaqueTy ( ..) => DefKind :: AssocOpaqueTy ,
305306 } ,
@@ -443,7 +444,7 @@ impl<'hir> Map<'hir> {
443444 Node :: Ctor ( ..)
444445 | Node :: Item ( & Item { kind : ItemKind :: Fn ( ..) , .. } )
445446 | Node :: TraitItem ( & TraitItem { kind : TraitItemKind :: Fn ( ..) , .. } )
446- | Node :: ImplItem ( & ImplItem { kind : ImplItemKind :: Method ( ..) , .. } ) => BodyOwnerKind :: Fn ,
447+ | Node :: ImplItem ( & ImplItem { kind : ImplItemKind :: Fn ( ..) , .. } ) => BodyOwnerKind :: Fn ,
447448 Node :: Item ( & Item { kind : ItemKind :: Static ( _, m, _) , .. } ) => BodyOwnerKind :: Static ( m) ,
448449 Node :: Expr ( & Expr { kind : ExprKind :: Closure ( ..) , .. } ) => BodyOwnerKind :: Closure ,
449450 node => bug ! ( "{:#?} is not a body node" , node) ,
@@ -749,7 +750,7 @@ impl<'hir> Map<'hir> {
749750 _ => false ,
750751 } ,
751752 Node :: ImplItem ( ii) => match ii. kind {
752- ImplItemKind :: Method ( ..) => true ,
753+ ImplItemKind :: Fn ( ..) => true ,
753754 _ => false ,
754755 } ,
755756 Node :: Block ( _) => true ,
@@ -1110,7 +1111,7 @@ fn hir_id_to_string(map: &Map<'_>, id: HirId, include_id: bool) -> String {
11101111 ImplItemKind :: Const ( ..) => {
11111112 format ! ( "assoc const {} in {}{}" , ii. ident, path_str( ) , id_str)
11121113 }
1113- ImplItemKind :: Method ( ..) => format ! ( "method {} in {}{}" , ii. ident, path_str( ) , id_str) ,
1114+ ImplItemKind :: Fn ( ..) => format ! ( "method {} in {}{}" , ii. ident, path_str( ) , id_str) ,
11141115 ImplItemKind :: TyAlias ( _) => {
11151116 format ! ( "assoc type {} in {}{}" , ii. ident, path_str( ) , id_str)
11161117 }
0 commit comments