mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-30 05:45:12 +00:00
Support trait aliases in IDE where type support isn't needed
This commit is contained in:
parent
29c957f973
commit
f8eac19b33
7 changed files with 95 additions and 29 deletions
|
@ -1355,6 +1355,38 @@ impl Foo {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_trait_alias() {
|
||||
check(
|
||||
r#"
|
||||
trait Foo {}
|
||||
trait Bar$0 = Foo where Self: ;
|
||||
fn foo<T: Bar>(_: impl Bar, _: &dyn Bar) {}
|
||||
"#,
|
||||
expect![[r#"
|
||||
Bar TraitAlias FileId(0) 13..42 19..22
|
||||
|
||||
FileId(0) 53..56
|
||||
FileId(0) 66..69
|
||||
FileId(0) 79..82
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_trait_alias_self() {
|
||||
check(
|
||||
r#"
|
||||
trait Foo = where Self$0: ;
|
||||
"#,
|
||||
expect![[r#"
|
||||
Self TypeParam FileId(0) 6..9 6..9
|
||||
|
||||
FileId(0) 18..22
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_attr_differs_from_fn_with_same_name() {
|
||||
check(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue