rust-lang / rust-lang/rust-analyzer
`auto_import` and flyimport for trait use imports should import with `as _` if another trait with the same name is already in scope
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
if another trait (or type) with the same name is already in scope.
Otherwise we have two traits with the same name in scope which is incorrect, and for these imports we are only interested in the assoc item set being in scope, so using as _ in this specific occasion is alright.
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 by locating the auto_import and flyimport handling in rust-analyzer and inspect how trait-use imports are resolved when a same-named trait or type is already in scope. Reproduce that collision and verify the behavior is covered for both import paths; it is done when these imports use as _ only for the described case without changing unrelated imports.
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