diff --git a/crates/hir/src/code_model.rs b/crates/hir/src/code_model.rs index 3277597c66..fadd010e2a 100644 --- a/crates/hir/src/code_model.rs +++ b/crates/hir/src/code_model.rs @@ -789,11 +789,7 @@ impl Function { } /// whether this function is associated with some trait/impl - pub fn is_associated(self, db: &dyn HirDatabase) -> bool { - if self.self_param(db).is_some() { - return false; - } - + pub fn is_assoc_item(self, db: &dyn HirDatabase) -> bool { let fn_parent_kind = self .source(db) .value diff --git a/crates/ide/src/syntax_highlighting.rs b/crates/ide/src/syntax_highlighting.rs index 3fcdb5e52f..41fd36edf8 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 { if func.is_unsafe(db) { h |= HighlightModifier::Unsafe; } - if func.is_associated(db) { + if func.is_assoc_item(db) && func.self_param(db).is_none() { h |= HighlightModifier::Static; } return h;