Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/ide/src/hover/tests.rs')
| -rw-r--r-- | crates/ide/src/hover/tests.rs | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/crates/ide/src/hover/tests.rs b/crates/ide/src/hover/tests.rs index 57e049c10d..baab746d74 100644 --- a/crates/ide/src/hover/tests.rs +++ b/crates/ide/src/hover/tests.rs @@ -3765,6 +3765,49 @@ pub fn gimme() -> theitem::TheItem { } #[test] +fn test_hover_trait_assoc_typealias() { + check( + r#" + fn main() {} + +trait T1 { + type Bar; + type Baz; +} + +struct Foo; + +mod t2 { + pub trait T2 { + type Bar; + } +} + +use t2::T2; + +impl T2 for Foo { + type Bar = String; +} + +impl T1 for Foo { + type Bar = <Foo as t2::T2>::Ba$0r; + // ^^^ unresolvedReference +} + "#, + expect![[r#" +*Bar* + +```rust +test::t2 +``` + +```rust +pub type Bar +``` +"#]], + ); +} +#[test] fn hover_generic_assoc() { check( r#" |