@@ -56,7 +56,7 @@ fn fn_decl<'hir>(node: Node<'hir>) -> Option<&'hir FnDecl<'hir>> {
56
56
} ,
57
57
58
58
Node :: ImplItem ( ref item) => match item. kind {
59
- ImplItemKind :: Method ( ref sig, _) => Some ( & sig. decl ) ,
59
+ ImplItemKind :: Fn ( ref sig, _) => Some ( & sig. decl ) ,
60
60
_ => None ,
61
61
} ,
62
62
@@ -82,7 +82,7 @@ fn fn_sig<'hir>(node: Node<'hir>) -> Option<&'hir FnSig<'hir>> {
82
82
} ,
83
83
84
84
Node :: ImplItem ( item) => match & item. kind {
85
- ImplItemKind :: Method ( sig, _) => Some ( sig) ,
85
+ ImplItemKind :: Fn ( sig, _) => Some ( sig) ,
86
86
_ => None ,
87
87
} ,
88
88
@@ -100,13 +100,14 @@ fn associated_body<'hir>(node: Node<'hir>) -> Option<BodyId> {
100
100
} ,
101
101
102
102
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
+ }
105
106
_ => None ,
106
107
} ,
107
108
108
109
Node :: ImplItem ( item) => match item. kind {
109
- ImplItemKind :: Const ( _, body) | ImplItemKind :: Method ( _, body) => Some ( body) ,
110
+ ImplItemKind :: Const ( _, body) | ImplItemKind :: Fn ( _, body) => Some ( body) ,
110
111
_ => None ,
111
112
} ,
112
113
@@ -299,7 +300,7 @@ impl<'hir> Map<'hir> {
299
300
} ,
300
301
Node :: ImplItem ( item) => match item. kind {
301
302
ImplItemKind :: Const ( ..) => DefKind :: AssocConst ,
302
- ImplItemKind :: Method ( ..) => DefKind :: AssocFn ,
303
+ ImplItemKind :: Fn ( ..) => DefKind :: AssocFn ,
303
304
ImplItemKind :: TyAlias ( ..) => DefKind :: AssocTy ,
304
305
ImplItemKind :: OpaqueTy ( ..) => DefKind :: AssocOpaqueTy ,
305
306
} ,
@@ -443,7 +444,7 @@ impl<'hir> Map<'hir> {
443
444
Node :: Ctor ( ..)
444
445
| Node :: Item ( & Item { kind : ItemKind :: Fn ( ..) , .. } )
445
446
| Node :: TraitItem ( & TraitItem { kind : TraitItemKind :: Fn ( ..) , .. } )
446
- | Node :: ImplItem ( & ImplItem { kind : ImplItemKind :: Method ( ..) , .. } ) => BodyOwnerKind :: Fn ,
447
+ | Node :: ImplItem ( & ImplItem { kind : ImplItemKind :: Fn ( ..) , .. } ) => BodyOwnerKind :: Fn ,
447
448
Node :: Item ( & Item { kind : ItemKind :: Static ( _, m, _) , .. } ) => BodyOwnerKind :: Static ( m) ,
448
449
Node :: Expr ( & Expr { kind : ExprKind :: Closure ( ..) , .. } ) => BodyOwnerKind :: Closure ,
449
450
node => bug ! ( "{:#?} is not a body node" , node) ,
@@ -749,7 +750,7 @@ impl<'hir> Map<'hir> {
749
750
_ => false ,
750
751
} ,
751
752
Node :: ImplItem ( ii) => match ii. kind {
752
- ImplItemKind :: Method ( ..) => true ,
753
+ ImplItemKind :: Fn ( ..) => true ,
753
754
_ => false ,
754
755
} ,
755
756
Node :: Block ( _) => true ,
@@ -1110,7 +1111,7 @@ fn hir_id_to_string(map: &Map<'_>, id: HirId, include_id: bool) -> String {
1110
1111
ImplItemKind :: Const ( ..) => {
1111
1112
format ! ( "assoc const {} in {}{}" , ii. ident, path_str( ) , id_str)
1112
1113
}
1113
- ImplItemKind :: Method ( ..) => format ! ( "method {} in {}{}" , ii. ident, path_str( ) , id_str) ,
1114
+ ImplItemKind :: Fn ( ..) => format ! ( "method {} in {}{}" , ii. ident, path_str( ) , id_str) ,
1114
1115
ImplItemKind :: TyAlias ( _) => {
1115
1116
format ! ( "assoc type {} in {}{}" , ii. ident, path_str( ) , id_str)
1116
1117
}
0 commit comments