rust-lang / rust-lang/rust-analyzer
`#[path = "../XXXXXX"]` attribute on modules gives false `unresolved-module` error
Open
Nobody has claimed this yet.
A-nameres
A-vfs
C-bug
S-unactionable
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description


Example: https://github.com/WilliamVenner/rust-analyzer-broken-example
Code:
./package/src/main.rs
#[path = "../../silly_mod/mod.rs"]
mod silly_mod;
fn main() {
silly_mod::hello();
}
./silly_mod/mod.rs
pub fn hello() {
println!("Hello, world!");
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the linked rust-analyzer-broken-example and the module layout shown in package/src/main.rs and silly_mod/mod.rs; reproduce the false unresolved-module diagnostic for the #[path] attribute. Trace the module-path resolution that handles this example, and consider the issue done when the valid module no longer produces that diagnostic.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100