diff options
author | Lukas Wirth <[email protected]> | 2021-04-01 17:01:18 +0100 |
---|---|---|
committer | Lukas Wirth <[email protected]> | 2021-04-01 20:31:25 +0100 |
commit | 444f6caababc3335b1ed51d08eeedac106fd8077 (patch) | |
tree | d99e32e304730f5472caf7606c4d8e6d3b959e89 /crates/ide/src | |
parent | 75011bbccbf2e00092222a1071ba9111f834a4ae (diff) |
Resolve associated types
Diffstat (limited to 'crates/ide/src')
-rw-r--r-- | crates/ide/src/hover.rs | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/crates/ide/src/hover.rs b/crates/ide/src/hover.rs index 5f9edb476..8f98056c1 100644 --- a/crates/ide/src/hover.rs +++ b/crates/ide/src/hover.rs | |||
@@ -3834,4 +3834,46 @@ fn foo() {} | |||
3834 | "#]], | 3834 | "#]], |
3835 | ); | 3835 | ); |
3836 | } | 3836 | } |
3837 | |||
3838 | #[test] | ||
3839 | fn hover_generic_assoc() { | ||
3840 | check( | ||
3841 | r#" | ||
3842 | fn foo<T: A>() where T::Assoc$0: {} | ||
3843 | |||
3844 | trait A { | ||
3845 | type Assoc; | ||
3846 | }"#, | ||
3847 | expect![[r#" | ||
3848 | *Assoc* | ||
3849 | |||
3850 | ```rust | ||
3851 | test | ||
3852 | ``` | ||
3853 | |||
3854 | ```rust | ||
3855 | type Assoc | ||
3856 | ``` | ||
3857 | "#]], | ||
3858 | ); | ||
3859 | check( | ||
3860 | r#" | ||
3861 | trait A where | ||
3862 | Self::Assoc$0: , | ||
3863 | { | ||
3864 | type Assoc; | ||
3865 | }"#, | ||
3866 | expect![[r#" | ||
3867 | *Assoc* | ||
3868 | |||
3869 | ```rust | ||
3870 | test | ||
3871 | ``` | ||
3872 | |||
3873 | ```rust | ||
3874 | type Assoc | ||
3875 | ``` | ||
3876 | "#]], | ||
3877 | ) | ||
3878 | } | ||
3837 | } | 3879 | } |