mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 07:04:49 +00:00
Fix name resolution when an import is resolved to some namespace and then later in the algorithm another namespace is added
The import is flagged as "indeterminate", and previously it was re-resolved, but only at the end of name resolution, when it's already too late for anything that depends on it. This issue was tried to fix in https://github.com/rust-lang/rust-analyzer/pull/2466, but it was not fixed fully.
This commit is contained in:
parent
6dad8c5528
commit
432b2559cd
3 changed files with 82 additions and 13 deletions
|
@ -2750,4 +2750,36 @@ fn foo() {
|
|||
"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn issue_18138() {
|
||||
check(
|
||||
r#"
|
||||
mod foo {
|
||||
macro_rules! x {
|
||||
() => {
|
||||
pub struct Foo;
|
||||
// ^^^
|
||||
};
|
||||
}
|
||||
pub(crate) use x as m;
|
||||
}
|
||||
|
||||
mod bar {
|
||||
use crate::m;
|
||||
|
||||
m!();
|
||||
// ^^^^^
|
||||
|
||||
fn qux() {
|
||||
Foo$0;
|
||||
}
|
||||
}
|
||||
|
||||
mod m {}
|
||||
|
||||
use foo::m;
|
||||
"#,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue