diff --git a/crates/hir/src/lib.rs b/crates/hir/src/lib.rs index e08dd8dadebc..f5324208c9a4 100644 --- a/crates/hir/src/lib.rs +++ b/crates/hir/src/lib.rs @@ -2807,6 +2807,10 @@ impl Type { let subst = TyBuilder::subst_for_def(db, id, None).fill_with_unknown().build(); Some(subst) } + ItemContainerId::ImplId(id) => { + let subst = TyBuilder::subst_for_def(db, id, None).fill_with_unknown().build(); + Some(subst) + } _ => None, }, _ => None, diff --git a/crates/ide/src/highlight_related.rs b/crates/ide/src/highlight_related.rs index 1bdd626f1e83..540a115832d3 100644 --- a/crates/ide/src/highlight_related.rs +++ b/crates/ide/src/highlight_related.rs @@ -1373,6 +1373,22 @@ fn main() { ().func$0(); //^^^^ } +"#, + ); + } + + #[test] + fn test_assoc_type_highlighting() { + check( + r#" +trait Trait { + type Output; + // ^^^^^^ +} +impl Trait for () { + type Output$0 = (); + // ^^^^^^ +} "#, ); }