From 9fe10a96069ea0f617ff86049bb50922b5424fae Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Thu, 1 Apr 2021 21:52:07 +0200 Subject: Resolve associated types with type anchors --- crates/ide/src/hover.rs | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'crates/ide/src') diff --git a/crates/ide/src/hover.rs b/crates/ide/src/hover.rs index 8f98056c1..28e2e17dc 100644 --- a/crates/ide/src/hover.rs +++ b/crates/ide/src/hover.rs @@ -3841,6 +3841,27 @@ fn foo() {} r#" fn foo() where T::Assoc$0: {} +trait A { + type Assoc; +}"#, + expect![[r#" + *Assoc* + + ```rust + test + ``` + + ```rust + type Assoc + ``` + "#]], + ); + check( + r#" +fn foo() { + let _: ::Assoc$0; +} + trait A { type Assoc; }"#, @@ -3874,6 +3895,6 @@ trait A where type Assoc ``` "#]], - ) + ); } } -- cgit v1.2.3