aboutsummaryrefslogtreecommitdiff
path: root/crates/hir
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir')
-rw-r--r--crates/hir/src/code_model.rs15
1 files changed, 1 insertions, 14 deletions
diff --git a/crates/hir/src/code_model.rs b/crates/hir/src/code_model.rs
index fadd010e2..30a5e4580 100644
--- a/crates/hir/src/code_model.rs
+++ b/crates/hir/src/code_model.rs
@@ -41,7 +41,7 @@ use rustc_hash::FxHashSet;
41use stdx::impl_from; 41use stdx::impl_from;
42use syntax::{ 42use syntax::{
43 ast::{self, AttrsOwner, NameOwner}, 43 ast::{self, AttrsOwner, NameOwner},
44 AstNode, SmolStr, SyntaxKind, 44 AstNode, SmolStr,
45}; 45};
46use tt::{Ident, Leaf, Literal, TokenTree}; 46use tt::{Ident, Leaf, Literal, TokenTree};
47 47
@@ -787,19 +787,6 @@ impl Function {
787 pub fn has_body(self, db: &dyn HirDatabase) -> bool { 787 pub fn has_body(self, db: &dyn HirDatabase) -> bool {
788 db.function_data(self.id).has_body 788 db.function_data(self.id).has_body
789 } 789 }
790
791 /// whether this function is associated with some trait/impl
792 pub fn is_assoc_item(self, db: &dyn HirDatabase) -> bool {
793 let fn_parent_kind = self
794 .source(db)
795 .value
796 .syntax()
797 .parent()
798 .and_then(|s| s.parent())
799 .and_then(|s| Some(s.kind()));
800
801 matches!(fn_parent_kind, Some(SyntaxKind::IMPL) | Some(SyntaxKind::TRAIT))
802 }
803} 790}
804 791
805// Note: logically, this belongs to `hir_ty`, but we are not using it there yet. 792// Note: logically, this belongs to `hir_ty`, but we are not using it there yet.