mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 20:09:19 +00:00
Resolve associated types
This commit is contained in:
parent
75011bbccb
commit
444f6caaba
4 changed files with 64 additions and 5 deletions
|
@ -3834,4 +3834,46 @@ fn foo() {}
|
|||
"#]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn hover_generic_assoc() {
|
||||
check(
|
||||
r#"
|
||||
fn foo<T: A>() where T::Assoc$0: {}
|
||||
|
||||
trait A {
|
||||
type Assoc;
|
||||
}"#,
|
||||
expect![[r#"
|
||||
*Assoc*
|
||||
|
||||
```rust
|
||||
test
|
||||
```
|
||||
|
||||
```rust
|
||||
type Assoc
|
||||
```
|
||||
"#]],
|
||||
);
|
||||
check(
|
||||
r#"
|
||||
trait A where
|
||||
Self::Assoc$0: ,
|
||||
{
|
||||
type Assoc;
|
||||
}"#,
|
||||
expect![[r#"
|
||||
*Assoc*
|
||||
|
||||
```rust
|
||||
test
|
||||
```
|
||||
|
||||
```rust
|
||||
type Assoc
|
||||
```
|
||||
"#]],
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue