mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
Complete variants and assoc items in path pattern through type aliases
This commit is contained in:
parent
2b61be2975
commit
ad17ba12d1
2 changed files with 28 additions and 0 deletions
|
@ -714,3 +714,30 @@ impl Ty {
|
|||
"#]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn through_alias() {
|
||||
check_empty(
|
||||
r#"
|
||||
enum Enum<T> {
|
||||
Unit,
|
||||
Tuple(T),
|
||||
}
|
||||
|
||||
type EnumAlias<T> = Enum<T>;
|
||||
|
||||
fn f(x: EnumAlias<u8>) {
|
||||
match x {
|
||||
EnumAlias::$0 => (),
|
||||
_ => (),
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
"#,
|
||||
expect![[r#"
|
||||
bn Tuple(…) Tuple($1)$0
|
||||
bn Unit Unit$0
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue