Support trait aliases in IDE where type support isn't needed

This commit is contained in:
Ryo Yoshida 2023-03-04 00:24:08 +09:00
parent 29c957f973
commit f8eac19b33
No known key found for this signature in database
GPG key ID: E25698A930586171
7 changed files with 95 additions and 29 deletions

View file

@ -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(