Closed
Description
rust-analyzer version: rust-analyzer version: 0.3.2291-standalone (f3998f7 2025-02-02) [/Users/UserName/.vscode/extensions/rust-lang.rust-analyzer-0.3.2291-darwin-arm64/server/rust-analyzer]
rustc version: rustc 1.84.1 (e71f9a9a9 2025-01-27)
editor or extension: VSCode, Version 0.3.2291
relevant settings: (eg. client settings, or environment variables like CARGO
, RUSTC
, RUSTUP_HOME
or CARGO_HOME
)
repository link (if public, optional): (eg. rust-analyzer)
When I hover over or rename sub2
in line 3, it is duplicated because both top level subs
as a struct and sub1::sub2
as a module are imported with use
.
Although sub2
is displayed as a struct, it is actually a module.
I think this issue related with #18941
code snippet to reproduce:
fn main() {
use sub1::sub2;
let module_sub1_sub2 = sub2::fn_sub2();
let top_level_struct_sub2 = sub2;
}
struct sub2;
impl sub2 {
fn fn_sub2() -> sub2 {
sub2
}
}
mod sub1 {
pub mod sub2 {
pub fn fn_sub2() {}
}
}