Skip to content

Fix auto-import namespace collision merges - #23219

Open
SomeFlyingThing wants to merge 5 commits into
rust-lang:masterfrom
SomeFlyingThing:fix/auto-import-namespace-collisions
Open

Fix auto-import namespace collision merges#23219
SomeFlyingThing wants to merge 5 commits into
rust-lang:masterfrom
SomeFlyingThing:fix/auto-import-namespace-collisions

Conversation

@SomeFlyingThing

@SomeFlyingThing SomeFlyingThing commented Aug 23, 2026

Copy link
Copy Markdown

Fixes module/function collisions (#19816⁠, #20790⁠) and module/macro collisions (#11278⁠).

it was assisted by a LLM

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 23, 2026

@ChayimFriedman2 ChayimFriedman2 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't fix this properly because a proper fix will be to only do that when there's actual collisions (things will resolve differently), and that we can't check. That said this approach is good enough for me.

View changes since this review

Comment thread crates/ide-db/src/imports/merge_imports.rs Outdated
Comment thread crates/ide-db/src/imports/insert_use.rs Outdated
@SomeFlyingThing

Copy link
Copy Markdown
Author

@rustbot ready

Remove self imports covered by the new explicit import, preserving distinct aliases and unrelated namespace bindings. Handle all import granularities and self imports appearing after another merge candidate.

Add regression tests for macro completion, nested imports, aliases, and imports kept separate.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants