Skip to content

Commit 7cab813

Browse files
committed
Only methods are fn-like, not other associated items
1 parent 3bea4d1 commit 7cab813

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/librustc/hir/map/blocks.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ impl MaybeFnLike for ast::Item {
5151
}
5252
}
5353

54+
impl MaybeFnLike for ast::ImplItem {
55+
fn is_fn_like(&self) -> bool {
56+
match self.node { ast::ImplItemKind::Method(..) => true, _ => false, }
57+
}
58+
}
59+
5460
impl MaybeFnLike for ast::TraitItem {
5561
fn is_fn_like(&self) -> bool {
5662
match self.node {
@@ -141,7 +147,7 @@ impl<'a> FnLikeNode<'a> {
141147
let fn_like = match node {
142148
map::NodeItem(item) => item.is_fn_like(),
143149
map::NodeTraitItem(tm) => tm.is_fn_like(),
144-
map::NodeImplItem(_) => true,
150+
map::NodeImplItem(it) => it.is_fn_like(),
145151
map::NodeExpr(e) => e.is_fn_like(),
146152
_ => false
147153
};

0 commit comments

Comments
 (0)