fix: Fix search for associated trait items being inconsistent

This commit is contained in:
Lukas Wirth 2022-07-20 13:59:31 +02:00
parent 84544134f6
commit bb4bfae422
4 changed files with 125 additions and 43 deletions

View file

@ -1307,6 +1307,70 @@ fn foo((
//^^^read
let foo;
}
"#,
);
}
#[test]
fn test_hl_trait_impl_methods() {
check(
r#"
trait Trait {
fn func$0(self) {}
//^^^^
}
impl Trait for () {
fn func(self) {}
//^^^^
}
fn main() {
<()>::func(());
//^^^^
().func();
//^^^^
}
"#,
);
check(
r#"
trait Trait {
fn func(self) {}
//^^^^
}
impl Trait for () {
fn func$0(self) {}
//^^^^
}
fn main() {
<()>::func(());
//^^^^
().func();
//^^^^
}
"#,
);
check(
r#"
trait Trait {
fn func(self) {}
//^^^^
}
impl Trait for () {
fn func(self) {}
//^^^^
}
fn main() {
<()>::func(());
//^^^^
().func$0();
//^^^^
}
"#,
);
}