Correctly resolve crate name in use paths when import shadows itself

This commit is contained in:
Lukas Tobias Wirth 2021-05-23 19:33:28 +02:00
parent f04daf693a
commit da74c66947
3 changed files with 31 additions and 3 deletions

View file

@ -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
```
"#]],
)
}
}