rust-lang / rust-lang/rust-analyzer
`unresolved import` for some `#[path = ".."]
Open
Nobody has claimed this yet.
A-vfs
S-actionable
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
- OS: Linux (Arch LInux)
- Toolchain:
stable-x86_64-unknown-linux-gnu(1.42.0) - rust-analyzer: https://github.com/rust-analyzer/rust-analyzer/commit/779555c1beac90f633c01a773558c4007c99c97f
unresolved import errors show up for:
- File paths whose extensions are not
rs - Absolute file paths
- Outside of the workspace (or simply
workspace_rootor somewhere?)

These files do exist.
$ tree -I target "$PWD"
/home/ryo/src/local/a
├── Cargo.lock
├── Cargo.toml
├── empty-file
├── empty-file.rs
└── src
└── main.rs
1 directory, 7 files
$ touch ./src/main.rs && cargo clippy
Checking a v0.1.0 (/home/ryo/src/local/a)
Finished dev [unoptimized + debuginfo] target(s) in 0.47s
$ # OK
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
Reproduce the report from the listed project tree, including src/main.rs, empty-file, and empty-file.rs, using the noted stable Rust toolchain and rust-analyzer revision. Start by running cargo clippy and tracing the unresolved-import diagnostics for #[path] cases involving non-Rust extensions, absolute paths, and paths outside the workspace; done means existing paths no longer produce false errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100