about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOliver Schneider <github35764891676564198441@oli-obk.de>2018-07-20 17:19:58 +0200
committerOliver Schneider <github35764891676564198441@oli-obk.de>2018-07-20 17:19:58 +0200
commit7cab813ad91ec7b2016ae3c0e6fc804becb2d623 (patch)
tree30e98da6f01059ce72e555df6d557ccc0fed7634
parent3bea4d1fc66b0ab1406c4c0e184af761485a3c6a (diff)
downloadrust-7cab813ad91ec7b2016ae3c0e6fc804becb2d623.tar.gz
rust-7cab813ad91ec7b2016ae3c0e6fc804becb2d623.zip
Only methods are fn-like, not other associated items
-rw-r--r--src/librustc/hir/map/blocks.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/librustc/hir/map/blocks.rs b/src/librustc/hir/map/blocks.rs
index 5a595d14db7..f2f7f95426a 100644
--- a/src/librustc/hir/map/blocks.rs
+++ b/src/librustc/hir/map/blocks.rs
@@ -51,6 +51,12 @@ impl MaybeFnLike for ast::Item {
     }
 }
 
+impl MaybeFnLike for ast::ImplItem {
+    fn is_fn_like(&self) -> bool {
+        match self.node { ast::ImplItemKind::Method(..) => true, _ => false, }
+    }
+}
+
 impl MaybeFnLike for ast::TraitItem {
     fn is_fn_like(&self) -> bool {
         match self.node {
@@ -141,7 +147,7 @@ impl<'a> FnLikeNode<'a> {
         let fn_like = match node {
             map::NodeItem(item) => item.is_fn_like(),
             map::NodeTraitItem(tm) => tm.is_fn_like(),
-            map::NodeImplItem(_) => true,
+            map::NodeImplItem(it) => it.is_fn_like(),
             map::NodeExpr(e) => e.is_fn_like(),
             _ => false
         };