mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-18 19:21:38 +00:00
Fix IDE resolution of use inside a body
We stopped the expression search too early because `use` is an item.
This commit is contained in:
parent
0fd4fc3522
commit
134b6f2228
2 changed files with 23 additions and 1 deletions
|
|
@ -3272,4 +3272,22 @@ fn f() {
|
|||
"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn use_inside_body() {
|
||||
check(
|
||||
r#"
|
||||
fn main() {
|
||||
mod nice_module {
|
||||
pub(super) struct NiceStruct;
|
||||
// ^^^^^^^^^^
|
||||
}
|
||||
|
||||
use nice_module::NiceStruct$0;
|
||||
|
||||
let _ = NiceStruct;
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue