mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-26 20:09:19 +00:00
Correctly resolve crate name in use paths when import shadows itself
This commit is contained in:
parent
f04daf693a
commit
da74c66947
3 changed files with 31 additions and 3 deletions
|
@ -3957,4 +3957,24 @@ mod string {
|
|||
"#]],
|
||||
)
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn function_doesnt_shadow_crate_in_use_tree() {
|
||||
check(
|
||||
r#"
|
||||
//- /main.rs crate:main deps:foo
|
||||
use foo$0::{foo};
|
||||
|
||||
//- /foo.rs crate:foo
|
||||
pub fn foo() {}
|
||||
"#,
|
||||
expect![[r#"
|
||||
*foo*
|
||||
|
||||
```rust
|
||||
extern crate foo
|
||||
```
|
||||
"#]],
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue