aboutsummaryrefslogtreecommitdiff
path: root/crates
diff options
context:
space:
mode:
Diffstat (limited to 'crates')
-rw-r--r--crates/hir/src/code_model.rs6
-rw-r--r--crates/ide/src/syntax_highlighting.rs2
2 files changed, 2 insertions, 6 deletions
diff --git a/crates/hir/src/code_model.rs b/crates/hir/src/code_model.rs
index 3277597c6..fadd010e2 100644
--- a/crates/hir/src/code_model.rs
+++ b/crates/hir/src/code_model.rs
@@ -789,11 +789,7 @@ impl Function {
789 } 789 }
790 790
791 /// whether this function is associated with some trait/impl 791 /// whether this function is associated with some trait/impl
792 pub fn is_associated(self, db: &dyn HirDatabase) -> bool { 792 pub fn is_assoc_item(self, db: &dyn HirDatabase) -> bool {
793 if self.self_param(db).is_some() {
794 return false;
795 }
796
797 let fn_parent_kind = self 793 let fn_parent_kind = self
798 .source(db) 794 .source(db)
799 .value 795 .value
diff --git a/crates/ide/src/syntax_highlighting.rs b/crates/ide/src/syntax_highlighting.rs
index 3fcdb5e52..41fd36edf 100644
--- a/crates/ide/src/syntax_highlighting.rs
+++ b/crates/ide/src/syntax_highlighting.rs
@@ -746,7 +746,7 @@ fn highlight_def(db: &RootDatabase, def: Definition) -> Highlight {
746 if func.is_unsafe(db) { 746 if func.is_unsafe(db) {
747 h |= HighlightModifier::Unsafe; 747 h |= HighlightModifier::Unsafe;
748 } 748 }
749 if func.is_associated(db) { 749 if func.is_assoc_item(db) && func.self_param(db).is_none() {
750 h |= HighlightModifier::Static; 750 h |= HighlightModifier::Static;
751 } 751 }
752 return h; 752 return h;