mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
fix: Fix search for associated trait items being inconsistent
This commit is contained in:
parent
84544134f6
commit
bb4bfae422
4 changed files with 125 additions and 43 deletions
|
@ -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();
|
||||
//^^^^
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue