Only methods are fn-like, not other associated items
This commit is contained in:
parent
3bea4d1fc6
commit
7cab813ad9
1 changed files with 7 additions and 1 deletions
|
|
@ -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
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue